Skip to content

HDDS-13723. Add detailed lock information for omMetadataManager locks#9157

Merged
ivandika3 merged 4 commits intoapache:masterfrom
sreejasahithi:HDDS-13723
Nov 22, 2025
Merged

HDDS-13723. Add detailed lock information for omMetadataManager locks#9157
ivandika3 merged 4 commits intoapache:masterfrom
sreejasahithi:HDDS-13723

Conversation

@sreejasahithi
Copy link
Contributor

What changes were proposed in this pull request?

HDDS-8974 introduced detailed lock information for almost all operations acquiring omMetadataManager locks by wrapping the lock acquisition with mergeOmLockDetails and tracking lockAcquired status.
However, a few places appear to have missed this pattern, including S3ExpiredMultipartUploadsAbortRequest and OMDirectoriesPurgeRequestWithFSO.

What is the link to the Apache JIRA

HDDS-13723

How was this patch tested?

Geen CI : https://github.com/sreejasahithi/ozone/actions/runs/18500762135

@peterxcli peterxcli requested a review from jojochuang October 15, 2025 11:16
@peterxcli peterxcli added the om label Oct 15, 2025
Copy link
Contributor

@ivandika3 ivandika3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sreejasahithi Thanks for the patch.

The main point of adding detailed lock information is for OM RPC FairCallQueue calculation (whether a particular UGI should be put to lower priority call queue if a lot of the RPC calls hold locks). However these are only effective if the request is sent through the OM RPC server (see OzoneManagerProtocolServerSideTranslatorPB#processRequest) and since OMDirectoriesPurgeRequestWithFSO and S3ExpiredMultipartUploadsAbortRequest are sent to Ratis server directly, merging the OM lock details might not have any noticeable effect.

@ivandika3 ivandika3 requested a review from symious October 17, 2025 01:47
@sreejasahithi
Copy link
Contributor Author

@sreejasahithi Thanks for the patch.

The main point of adding detailed lock information is for OM RPC FairCallQueue calculation (whether a particular UGI should be put to lower priority call queue if a lot of the RPC calls hold locks). However these are only effective if the request is sent through the OM RPC server (see OzoneManagerProtocolServerSideTranslatorPB#processRequest) and since OMDirectoriesPurgeRequestWithFSO and S3ExpiredMultipartUploadsAbortRequest are sent to Ratis server directly, merging the OM lock details might not have any noticeable effect.

Thanks for the review, @ivandika3 and for pointing this out. @jojochuang, what are your thoughts on this?

@jojochuang
Copy link
Contributor

@ivandika3 thanks for the clarification. That being said, a number of request types are also issued via OM Ratis directly (e.g. PurgeKeys, PurgeDirectories) but their handlers do record detailed OM lock information.

Ok. Looks like we can just close the PR as it is intended.

@ivandika3
Copy link
Contributor

That being said, a number of request types are also issued via OM Ratis directly (e.g. PurgeKeys, PurgeDirectories) but their handlers do record detailed OM lock information.

@jojochuang Yes, I think these requests follow the current convention.

IMO I'm OK if we go ahead with this change as a way to standardize the usage of locks (the overhead should not be that large). We can extract these locking methods instead. In the future, we might want to defer the background service in another process and the OM lock details.

@sreejasahithi
Copy link
Contributor Author

Thanks @ivandika3 , @jojochuang, Since the goal is to standardize usage of locks across all request types, I’ll keep the current change. Let me know if there are any more comments.

@ivandika3
Copy link
Contributor

@sreejasahithi Thanks for the patch, left some comments.

Could you help double check whether there are other requests with similar situations?

entry.setValue(entry.getValue().copyObject());
}
omMetadataManager.getLock().releaseWriteLocks(BUCKET_LOCK, bucketLockKeys);
mergeOmLockDetails(omMetadataManager.getLock().releaseWriteLocks(BUCKET_LOCK, bucketLockKeys));
Copy link
Contributor

@ivandika3 ivandika3 Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should only call releaseWriteLocks, if isLockAcquired is set to true (similar situation in OmKeyPurgeRequest). @swamirishi please help to advise here, I'm not familiar with the new bulk locks feature.

@ivandika3 ivandika3 requested a review from swamirishi November 15, 2025 06:34
Copy link
Contributor

@sumitagrawl sumitagrawl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sreejasahithi given minor comment

Copy link
Contributor

@sumitagrawl sumitagrawl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ivandika3 ivandika3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1.

@ivandika3 ivandika3 merged commit acc8a86 into apache:master Nov 22, 2025
83 of 84 checks passed
@ivandika3
Copy link
Contributor

Thanks @sreejasahithi for the patch and @sumitagrawl , @jojochuang for the reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants