HDDS-13982. OmKeyInfo fileName possible inconsistency between cache and DB#9381
Conversation
| openKeyToDelete.setModificationTime(Time.now()); | ||
| OMFileRequest.addOpenFileTableCacheEntry(omMetadataManager, | ||
| dbOpenKeyToDeleteKey, openKeyToDelete, keyName, fileName, trxnLogIndex); | ||
| dbOpenKeyToDeleteKey, openKeyToDelete, fileName, trxnLogIndex); |
There was a problem hiding this comment.
@ChenSammi I believe this is a bug in hsync: order of keyName and fileName is mixed up.
Parameters:
Arguments:
Should we be passing keyName instead of fileName?
There was a problem hiding this comment.
@adoroszlai , good catch! Yeah, keyName and fileName was accidentally passed in with a reversed order.
|
@smengcl could you please review? |
|
Thanks @adoroszlai for the fix. Would It be better to create an This approach would prevent from calling these methods during OBS operations. |
ChenSammi
left a comment
There was a problem hiding this comment.
Thanks @adoroszlai for this improvement. The last patch LGTM.
|
Thanks @ChenSammi, @chungen0126 for the review.
I'll give it a try in a follow-up. |
What changes were proposed in this pull request?
OmKeyInfo#fileNameis not persisted to DB, but set during deserialization based onkeyName. This happens even if theOmKeyInfodid not havefileNameinitially. Thus thefileNamemay be different for the instance added to the table cache and the one read from DB. To avoid that, FSO requests need to manuallysetFileName, which is error-prone.This PR changes
OmKeyInfoto setfileNamewheneverkeyNameis initialized (inbuild()) or updated.https://issues.apache.org/jira/browse/HDDS-13982
How was this patch tested?
Updated unit and integration test case.
https://github.com/adoroszlai/ozone/actions/runs/19699233660