HADOOP-18528. Disable abfs prefetching by default (#5134)
Disables block prefetching on ABFS InputStreams, by setting fs.azure.enable.readahead to false in core-default.xml and the matching java constant. This prevents HADOOP-18521. ABFS ReadBufferManager buffer sharing across concurrent HTTP requests. Once a fix for that is committed, this change can be reverted. Contributed by Mehakmeet Singh.
This commit is contained in:
parent
033ceca090
commit
9e53ed3602
|
@ -2141,6 +2141,13 @@ The switch to turn S3A auditing on or off.
|
|||
<description>The AbstractFileSystem for gs: uris.</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>fs.azure.enable.readahead</name>
|
||||
<value>false</value>
|
||||
<description>Disable readahead/prefetching in AbfsInputStream.
|
||||
See HADOOP-18521</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>io.seqfile.compress.blocksize</name>
|
||||
<value>1000000</value>
|
||||
|
|
|
@ -106,7 +106,7 @@ public final class FileSystemConfigurations {
|
|||
public static final boolean DEFAULT_ABFS_LATENCY_TRACK = false;
|
||||
public static final long DEFAULT_SAS_TOKEN_RENEW_PERIOD_FOR_STREAMS_IN_SECONDS = 120;
|
||||
|
||||
public static final boolean DEFAULT_ENABLE_READAHEAD = true;
|
||||
public static final boolean DEFAULT_ENABLE_READAHEAD = false;
|
||||
public static final String DEFAULT_FS_AZURE_USER_AGENT_PREFIX = EMPTY_STRING;
|
||||
public static final String DEFAULT_VALUE_UNKNOWN = "UNKNOWN";
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public class AbfsInputStreamContext extends AbfsStreamContext {
|
|||
|
||||
private boolean tolerateOobAppends;
|
||||
|
||||
private boolean isReadAheadEnabled = true;
|
||||
private boolean isReadAheadEnabled = false;
|
||||
|
||||
private boolean alwaysReadBufferSize;
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.apache.hadoop.fs.contract.AbstractFSContract;
|
|||
|
||||
import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.AZURE_READ_AHEAD_RANGE;
|
||||
import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.AZURE_READ_BUFFER_SIZE;
|
||||
import static org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys.FS_AZURE_ENABLE_READAHEAD;
|
||||
import static org.apache.hadoop.fs.azurebfs.constants.FileSystemConfigurations.MIN_BUFFER_SIZE;
|
||||
import static org.apache.hadoop.fs.contract.ContractTestUtils.createFile;
|
||||
import static org.apache.hadoop.fs.contract.ContractTestUtils.dataset;
|
||||
|
@ -68,6 +69,7 @@ public class ITestAbfsFileSystemContractSeek extends AbstractContractSeekTest{
|
|||
protected AbstractFSContract createContract(final Configuration conf) {
|
||||
conf.setInt(AZURE_READ_AHEAD_RANGE, MIN_BUFFER_SIZE);
|
||||
conf.setInt(AZURE_READ_BUFFER_SIZE, MIN_BUFFER_SIZE);
|
||||
conf.setBoolean(FS_AZURE_ENABLE_READAHEAD, true);
|
||||
return new AbfsFileSystemContract(conf, isSecure);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ public class TestAbfsInputStream extends
|
|||
private AbfsInputStream getAbfsInputStream(AbfsClient mockAbfsClient,
|
||||
String fileName) throws IOException {
|
||||
AbfsInputStreamContext inputStreamContext = new AbfsInputStreamContext(-1);
|
||||
inputStreamContext.isReadAheadEnabled(true);
|
||||
// Create AbfsInputStream with the client instance
|
||||
AbfsInputStream inputStream = new AbfsInputStream(
|
||||
mockAbfsClient,
|
||||
|
@ -131,6 +132,7 @@ public class TestAbfsInputStream extends
|
|||
boolean alwaysReadBufferSize,
|
||||
int readAheadBlockSize) throws IOException {
|
||||
AbfsInputStreamContext inputStreamContext = new AbfsInputStreamContext(-1);
|
||||
inputStreamContext.isReadAheadEnabled(true);
|
||||
// Create AbfsInputStream with the client instance
|
||||
AbfsInputStream inputStream = new AbfsInputStream(
|
||||
abfsClient,
|
||||
|
|
Loading…
Reference in New Issue