Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e672ae3
Rename retry recovery changes
sreeb-msft Mar 17, 2023
f53b43c
Changes to mock behavior
sreeb-msft Mar 17, 2023
1abc380
Added comments
sreeb-msft Mar 17, 2023
e8ce29f
Changes to test methods
sreeb-msft Mar 17, 2023
4426ad7
Added config for rename resilience
sreeb-msft Mar 20, 2023
1dcd6ce
Namespace check + IOStats counters test
sreeb-msft Mar 20, 2023
d93ae01
Enabling tests at fs level
sreeb-msft Mar 20, 2023
a2cd3be
Changesfor dir rename recovery skip
sreeb-msft Mar 20, 2023
e7b6b86
Change in integration tests
sreeb-msft Mar 21, 2023
ff9bd4e
Test Changes
sreeb-msft Mar 21, 2023
59db26d
Resolving conflicts
steveloughran Mar 20, 2023
13b6c24
Test + HNS check changes
sreeb-msft Mar 23, 2023
4801a9f
HNS check changes
sreeb-msft Mar 24, 2023
df59cfb
isDir variable changes
sreeb-msft Mar 24, 2023
749dc42
Review feedback changes
sreeb-msft Mar 24, 2023
82f4ce5
Import changes
sreeb-msft Mar 24, 2023
a009695
Changed setAbfsClient back to protected
sreeb-msft Mar 24, 2023
dc1e7c8
Spacing Changes
sreeb-msft Mar 24, 2023
aec848c
Spacing Changes
sreeb-msft Mar 24, 2023
7f9dfa4
Recovery to be attempted even for rename parent path not found
sreeb-msft Mar 24, 2023
63957ff
Nit changes
sreeb-msft Mar 24, 2023
ff0141b
Reverting HNS Check changes
sreeb-msft Mar 27, 2023
00e286a
Metadata incomplete clause change
sreeb-msft Mar 28, 2023
382bbf9
Nit changes
sreeb-msft Mar 28, 2023
6686fbe
Style changes
sreeb-msft Mar 31, 2023
9164102
Merge branch 'trunk' into HADOOP-18012
sreeb-msft Mar 31, 2023
447254f
Checkstyle changes
sreeb-msft Mar 31, 2023
585d101
Merge branch 'HADOOP-18012' of https://github.com/sreeb-msft/hadoop i…
sreeb-msft Mar 31, 2023
d202799
Removing redundant import
sreeb-msft Mar 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ public class AbfsConfiguration{
FS_AZURE_ENABLE_ABFS_LIST_ITERATOR, DefaultValue = DEFAULT_ENABLE_ABFS_LIST_ITERATOR)
private boolean enableAbfsListIterator;

@BooleanConfigurationValidatorAnnotation(ConfigurationKey =
FS_AZURE_ABFS_RENAME_RESILIENCE, DefaultValue = DEFAULT_ENABLE_ABFS_RENAME_RESILIENCE)
private boolean renameResilience;

public AbfsConfiguration(final Configuration rawConfig, String accountName)
throws IllegalAccessException, InvalidConfigurationValueException, IOException {
this.rawConfig = ProviderUtils.excludeIncompatibleCredentialProviders(
Expand Down Expand Up @@ -1130,4 +1134,11 @@ public void setEnableAbfsListIterator(boolean enableAbfsListIterator) {
this.enableAbfsListIterator = enableAbfsListIterator;
}

public boolean getRenameResilience() {
return renameResilience;
}

void setRenameResilience(boolean actualResilience) {
renameResilience = actualResilience;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,10 @@ public boolean rename(final Path src, final Path dst) throws IOException {
return dstFileStatus.isDirectory() ? false : true;
}

boolean isNamespaceEnabled = abfsStore.getIsNamespaceEnabled(tracingContext);

// Non-HNS account need to check dst status on driver side.
if (!abfsStore.getIsNamespaceEnabled(tracingContext) && dstFileStatus == null) {
if (!isNamespaceEnabled && dstFileStatus == null) {
dstFileStatus = tryGetFileStatus(qualifiedDstPath, tracingContext);
}

Expand All @@ -459,7 +461,7 @@ public boolean rename(final Path src, final Path dst) throws IOException {

qualifiedDstPath = makeQualified(adjustedDst);

abfsStore.rename(qualifiedSrcPath, qualifiedDstPath, tracingContext, null);
abfsStore.rename(qualifiedSrcPath, qualifiedDstPath, tracingContext, null, isNamespaceEnabled);
return true;
} catch (AzureBlobFileSystemException ex) {
LOG.debug("Rename operation failed. ", ex);
Expand Down Expand Up @@ -535,12 +537,14 @@ public Pair<Boolean, Duration> commitSingleFileByRename(
throw new PathIOException(qualifiedSrcPath.toString(), "cannot rename object onto self");
}

boolean isNamespaceEnabled = abfsStore.getIsNamespaceEnabled(tracingContext);

// acquire one IO permit
final Duration waitTime = rateLimiting.acquire(1);

try {
final boolean recovered = abfsStore.rename(qualifiedSrcPath,
qualifiedDstPath, tracingContext, sourceEtag);
qualifiedDstPath, tracingContext, sourceEtag, isNamespaceEnabled);
return Pair.of(recovered, waitTime);
} catch (AzureBlobFileSystemException ex) {
LOG.debug("Rename operation failed. ", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,8 @@ public void breakLease(final Path path, final TracingContext tracingContext) thr
public boolean rename(final Path source,
final Path destination,
final TracingContext tracingContext,
final String sourceEtag) throws
final String sourceEtag,
final boolean isNamespaceEnabled) throws
AzureBlobFileSystemException {
final Instant startAggregate = abfsPerfTracker.getLatencyInstant();
long countAggregate = 0;
Expand All @@ -924,7 +925,8 @@ public boolean rename(final Path source,
try (AbfsPerfInfo perfInfo = startTracking("rename", "renamePath")) {
final AbfsClientRenameResult abfsClientRenameResult =
client.renamePath(sourceRelativePath, destinationRelativePath,
continuation, tracingContext, sourceEtag, false);
continuation, tracingContext, sourceEtag, false,
isNamespaceEnabled);

AbfsRestOperation op = abfsClientRenameResult.getOp();
perfInfo.registerResult(op.getResult());
Expand Down Expand Up @@ -1914,7 +1916,7 @@ public AbfsClient getClient() {
}

@VisibleForTesting
void setClient(AbfsClient client) {
public void setClient(AbfsClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ public final class ConfigurationKeys {
/** Key for rate limit capacity, as used by IO operations which try to throttle themselves. */
public static final String FS_AZURE_ABFS_IO_RATE_LIMIT = "fs.azure.io.rate.limit";

/** Add extra resilience to rename failures, at the expense of performance. */
public static final String FS_AZURE_ABFS_RENAME_RESILIENCE = "fs.azure.enable.rename.resilience";

public static String accountProperty(String property, String account) {
return property + "." + account;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public final class FileSystemConfigurations {

public static final int STREAM_ID_LEN = 12;
public static final boolean DEFAULT_ENABLE_ABFS_LIST_ITERATOR = true;
public static final boolean DEFAULT_ENABLE_ABFS_RENAME_RESILIENCE = true;

/**
* Limit of queued block upload operations before writes
Expand Down
Loading