Skip to content

Commit

Permalink
Add comments regarding keyName change.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishk committed Apr 29, 2024
1 parent 36480ec commit f8beec3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,9 @@ public ExpiredOpenKeys getExpiredOpenKeys(Duration expireThreshold,
!openKeyInfo.getMetadata().containsKey(OzoneConsts.LEASE_RECOVERY)) {
// add hsync'ed keys
final OmKeyInfo info = kt.get(dbKeyName);
// Set keyName from openFileTable which contains keyName with full path like(/a/b/c/d/e/file1),
// which is required in commit key request.
// Whereas fileTable contains only leaf in keyName(like file1) and so cannot be used in commit request.
final KeyArgs.Builder keyArgs = KeyArgs.newBuilder()
.setVolumeName(info.getVolumeName())
.setBucketName(info.getBucketName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,12 @@ public static void addOpenFileTableCacheEntry(
final Table<String, OmKeyInfo> table = omMetadataManager.getOpenKeyTable(
BucketLayout.FILE_SYSTEM_OPTIMIZED);
if (omFileInfo != null) {
// Set keyName as fileName along with path
// For example, the user given key path is '/a/b/c/d/e/file1', then in DB
// keyName field stores full path, which is '/a/b/c/d/e/file1'.
// This is required as in some cases like hsync, Keys inside openKeyTable is used for auto commit after expiry.
// (Full key path is required in commit key request)
omFileInfo.setKeyName(keyName);
// fileName will contain only the leaf(file1) which is actual file name.
omFileInfo.setFileName(fileName);
table.addCacheEntry(dbOpenFileName, omFileInfo, trxnLogIndex);
} else {
Expand Down

0 comments on commit f8beec3

Please sign in to comment.