-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-13021. Make callId unique for each request in AbstractKeyDeletingService #8432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,7 @@ public abstract class AbstractKeyDeletingService extends BackgroundService | |
| private final AtomicLong movedDirsCount; | ||
| private final AtomicLong movedFilesCount; | ||
| private final AtomicLong runCount; | ||
| private final AtomicLong callId; | ||
| private final BootstrapStateHandler.Lock lock = | ||
| new BootstrapStateHandler.Lock(); | ||
|
|
||
|
|
@@ -97,6 +98,7 @@ public AbstractKeyDeletingService(String serviceName, long interval, | |
| this.runCount = new AtomicLong(0); | ||
| this.metrics = ozoneManager.getDeletionMetrics(); | ||
| this.perfMetrics = ozoneManager.getPerfMetrics(); | ||
| this.callId = new AtomicLong(0); | ||
| } | ||
|
|
||
| protected int processKeyDeletes(List<BlockGroup> keyBlocksList, | ||
|
|
@@ -220,7 +222,7 @@ private int submitPurgeKeysRequest(List<DeleteBlockGroupResult> results, | |
|
|
||
| // Submit PurgeKeys request to OM | ||
| try { | ||
| OzoneManagerRatisUtils.submitRequest(ozoneManager, omRequest, clientId, runCount.get()); | ||
| submitRequest(omRequest); | ||
| } catch (ServiceException e) { | ||
| LOG.error("PurgeKey request failed. Will retry at next run.", e); | ||
| return 0; | ||
|
|
@@ -229,6 +231,10 @@ private int submitPurgeKeysRequest(List<DeleteBlockGroupResult> results, | |
| return deletedCount; | ||
| } | ||
|
|
||
| protected OzoneManagerProtocolProtos.OMResponse submitRequest(OMRequest omRequest) throws ServiceException { | ||
| return OzoneManagerRatisUtils.submitRequest(ozoneManager, omRequest, clientId, callId.incrementAndGet()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and i think this API is easy to misuse. We need a little more javadoc for the callId so caller is expected to ensure callId is unique for different requests but remains the same for the same request.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HDDS-11807 is another example of misuse. |
||
| } | ||
|
|
||
| /** | ||
| * Parse Volume and Bucket Name from ObjectKey and add it to given map of | ||
| * keys to be purged per bucket. | ||
|
|
@@ -250,7 +256,7 @@ private void addToMap(Map<Pair<String, String>, List<String>> map, String object | |
|
|
||
| protected void submitPurgePaths(List<PurgePathRequest> requests, | ||
| String snapTableKey, | ||
| UUID expectedPreviousSnapshotId, long rnCnt) { | ||
| UUID expectedPreviousSnapshotId) { | ||
| OzoneManagerProtocolProtos.PurgeDirectoriesRequest.Builder purgeDirRequest = | ||
| OzoneManagerProtocolProtos.PurgeDirectoriesRequest.newBuilder(); | ||
|
|
||
|
|
@@ -275,7 +281,7 @@ protected void submitPurgePaths(List<PurgePathRequest> requests, | |
|
|
||
| // Submit Purge paths request to OM | ||
| try { | ||
| OzoneManagerRatisUtils.submitRequest(ozoneManager, omRequest, clientId, rnCnt); | ||
| submitRequest(omRequest); | ||
| } catch (ServiceException e) { | ||
| LOG.error("PurgePaths request failed. Will retry at next run.", e); | ||
| } | ||
|
|
@@ -403,7 +409,7 @@ public void optimizeDirDeletesAndSubmitRequest( | |
| } | ||
|
|
||
| if (!purgePathRequestList.isEmpty()) { | ||
| submitPurgePaths(purgePathRequestList, snapTableKey, expectedPreviousSnapshotId, rnCnt); | ||
| submitPurgePaths(purgePathRequestList, snapTableKey, expectedPreviousSnapshotId); | ||
| } | ||
|
|
||
| if (dirNum != 0 || subDirNum != 0 || subFileNum != 0) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.