Skip to content

Conversation

@kaijchen
Copy link
Member

@kaijchen kaijchen commented Mar 23, 2022

What changes were proposed in this pull request?

Support getting expired FSO keys in OMMetadataManagerImpl#getExpiredOpenKeys() by adding a BucketLayout parameter.

Return List<OpenKeyBucket> instead of List<String>.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-6491

How was this patch tested?

Unit test.

@kaijchen kaijchen marked this pull request as draft March 24, 2022 08:28
@kaijchen kaijchen changed the title HDDS-6491. Implement OmMetadataMangerImpl#getExpiredOpenFiles HDDS-6491. Support FSO keys in OmMetadataMangerImpl#getExpiredOpenKeys Mar 25, 2022
@kaijchen kaijchen changed the title HDDS-6491. Support FSO keys in OmMetadataMangerImpl#getExpiredOpenKeys HDDS-6491. Support FSO keys in getExpiredOpenKeys Mar 25, 2022
@kaijchen kaijchen force-pushed the HDDS-6491 branch 4 times, most recently from 22b3969 to 7c519a0 Compare March 26, 2022 02:25
@kaijchen kaijchen marked this pull request as ready for review April 19, 2022 06:39
@kaijchen
Copy link
Member Author

I have reworked this patch using the List<OpenKeyBucket> approach.
Cc @rakeshadr and @errose28 for review.

Copy link
Contributor

@kerneltime kerneltime left a comment

Choose a reason for hiding this comment

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

minor nits around inline path calculations that should be extracted out and tested independently.

Copy link
Contributor

@errose28 errose28 left a comment

Choose a reason for hiding this comment

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

Sorry I was late getting to this @kaijchen. Mostly lgtm with a few comments.

message OpenKey {
required string name = 1;
required uint64 clientID = 2;
optional uint64 parentID = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we tracking parent ID here, instead of just putting the open key DB name as the name field? This comment made it sound like we were just tracking the name as it appears in the open key/file table. Also I think we would need a field to indicate which table (key or file) this key must be retrieved from.

Copy link
Member Author

@kaijchen kaijchen May 6, 2022

Choose a reason for hiding this comment

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

For the same reason, maybe we can get rid of clientID also?

We just need 2 fields to indicate an open key:

  1. dbKeyName: /volumeName/bucketName/keyName/clientID or parentID/fileName/clientID.
  2. bucketLayout: FILE_SYSTEM_OPTIMIZED or others.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this will work. The bucket layout should be set based on whether the key was retrieved from the open key table or open file table, since the bucket itself may no longer exist. The field will be used by followers to know which table they need to move the key from.

It is interesting that FSO has its own table for open keys, but looks to share the same delete table as OBS and LEGACY keys. I would think there would either be different tables for both or they would both use the same table. Either way, by having this bucket layout field we could handle a delete table unique to FSO in the future. cc @rakeshadr to inquire why the tables are used in this way out of curiosity, although it does not really affect this patch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since removing a field in proto is hard, I decide not to add BucketLayout for now.
Because the caller must know which bucketLayout it has passed to getExpiredOpenKeys.
Maybe we should add bucketLayout in OpenKeysDeleteRequest instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

@errose28 Thanks for bringing up this point.

It is interesting that FSO has its own table for open keys, but looks to share the same delete table as OBS and LEGACY keys. I would think there would either be different tables for both or they would both use the same table.

Following are the bucket layout FSO feature specific tables. Since KeyDeletingService uses an offline table which handles deleted files and its physical block cleanup, we thought of making use of the existing logic with minimal efforts for the cleanup and again there was no requirement to introduce a logic based on specific bucket layout types. I am open to introduce a FSO specific table if there is a strong requirement.

* FSO/Prefix Tables:
* |----------------------------------------------------------------------|
* |  directoryTable    | parentId/directoryName -> DirectoryInfo         | 
* |----------------------------------------------------------------------|
* |  fileTable         | parentId/fileName -> KeyInfo                    |
* |----------------------------------------------------------------------|
* |  openFileTable     | parentId/fileName/id -> KeyInfo                 |
* |----------------------------------------------------------------------|
* |  deletedDirTable   | parentId/directoryName -> KeyInfo    
* |----------------------------------------------------------------------|

@kaijchen kaijchen requested a review from errose28 May 13, 2022 04:40
@kaijchen
Copy link
Member Author

I have decided not to add the BucketLayout in OpenKeyBucket proto in this patch for following reasons:

  1. We are processing one kind of bucket at a time in getExpiredOpenKeys, the caller must know the BucketLayout it passed in. And all the expired keys got are in that kind of bucket.
  2. Removing a field from proto is hard, it's better to add it in HDDS-4123 if we really need. I think adding BucketLayout in OpenKeysDeleteRequest is another feasible option.

Please take another look @errose28, thanks.

Copy link
Member

@captainzmc captainzmc left a comment

Choose a reason for hiding this comment

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

+1 The change looks good.

@captainzmc
Copy link
Member

Let's merge this and continue remaining tasks of HDDS-4120. Thanks @kaijchen for the patch and thanks @errose28 @rakeshadr @kerneltime for the review.

@captainzmc captainzmc merged commit f328aa0 into apache:master May 19, 2022
@kaijchen
Copy link
Member Author

Thanks @errose28 @rakeshadr @kerneltime and @captainzmc for the review.
We can proceed to HDDS-6476 now.

@kaijchen kaijchen deleted the HDDS-6491 branch May 19, 2022 08:04
errose28 added a commit to errose28/ozone that referenced this pull request May 20, 2022
* master: (96 commits)
  HDDS-6738. Migrate tests with rules in hdds-server-framework to JUnit5 (apache#3415)
  HDDS-6650. S3MultipartUpload support update bucket usedNamespace. (apache#3404)
  HDDS-6491. Support FSO keys in getExpiredOpenKeys (apache#3226)
  HDDS-6596. EC: Support ListBlock from CoordinatorDN (apache#3410)
  HDDS-6737. Migrate parameterized tests in hdds-server-framework to JUnit5 (apache#3414)
  HDDS-6660: EC: Add the DN side Reconstruction Handler class. (apache#3399)
  HDDS-6750. Migrate simple tests in hdds-server-scm to JUnit5 (apache#3417)
  HDDS-6749. SCM includes itself as peer in addSCM request (apache#3413)
  HDDS-6657. Improve Ozone integrated Ranger configuration instructions (apache#3365)
  HDDS-6742. Audit operation category mismatch (apache#3407)
  HDDS-6748. Intermittent timeout in TestECBlockReconstructedInputStream#testReadDataWithUnbuffer (apache#3416)
  HDDS-6731. Migrate simple tests in hdds-server-framework to JUnit5 (apache#3412)
  HDDS-5919. In kubernetes OM HA has circular dependency on service availability (apache#3185)
  HDDS-6730. Migrate tests in hdds-tools to JUnit5 (apache#3402)
  HDDS-6630. Explicitly remove node after being chosen (apache#3332)
  HDDS-6560. Add general Grafana dashboard (apache#3285)
  HDDS-6704. EC: ReplicationManager - create version of ContainerReplicaCounts applicable to EC (apache#3405)
  HDDS-6680. Pre-Finalize behaviour for Bucket Layout Feature. (apache#3377)
  HDDS-6619. Add freon command to run r/w mix workload using ObjectStore APIs (apache#3383)
  HDDS-6734. ozone admin pipeline list CLI is not backward compatible (apache#3406)
  ...

Conflicts:
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/metadata/SCMMetadataStore.java
hadoop-hdds/interface-server/src/main/proto/SCMRatisProtocol.proto
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/metadata/SCMDBDefinition.java
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/metadata/SCMMetadataStoreImpl.java
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java
kaijchen added a commit to kaijchen/ozone that referenced this pull request Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants