Skip to content

HDDS-13228. Take snapshot cache lock during the last iteration of tarball transfer. - #8678

Merged
sadanand48 merged 5 commits into
apache:masterfrom
sadanand48:HDDS-13228
Jul 10, 2025
Merged

HDDS-13228. Take snapshot cache lock during the last iteration of tarball transfer.#8678
sadanand48 merged 5 commits into
apache:masterfrom
sadanand48:HDDS-13228

Conversation

@sadanand48

@sadanand48sadanand48 commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Take snapshot cache lock during the last iteration of tarball transfer

What is the link to the Apache JIRA

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

How was this patch tested?

Unit tests

@sadanand48sadanand48 added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Jun 23, 2025
@sadanand48
sadanand48 marked this pull request as ready for review June 26, 2025 06:13
Comment threadhadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java Outdated
@jojochuang
jojochuang self-requested a review July 8, 2025 14:35
LOG.warn("SnapshotId: '{}' does not exist in snapshot cache.", k);
} else {
try {
v.get().getMetadataManager().getStore().flushDB();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this necessary?
https://javadoc.io/doc/org.rocksdb/rocksdbjni/6.8.1/org/rocksdb/Options.html#avoidFlushDuringShutdown()

By default RocksDB will flush all memtables on DB close if there are unpersisted data (i.e. with WAL disabled) T

@sadanand48sadanand48Jul 8, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Without this, I didn't find the .sst file visible in the rocksdb directory which is why I added it because the WAL is enabled in our case.

@jojochuangjojochuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few cosmetic issues but overall looks fine. Made a few suggestions we can incorporate them in later PRs.

OM_DB_NAME + checkpointDirName;
}

public static String extractSnapshotIDFromCheckpointDirName(String snapshotPath) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this public static method does not have test coverage, is only used by OMDBCheckpointServletInodeBasedXfer, and does not use any internal variables or method inside OmSnapshotManager. It should be moved into OMDBCheckpointServletInodeBasedXfer as a private method.

Otherwise if it is intended to be used as is later, please add javadoc and test coverage.

when(responseMock.getOutputStream()).thenReturn(servletOutputStream);
}

String getValueFromSnapshotDeleteTable(String key, String snapshotDB) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
StringgetValueFromSnapshotDeleteTable(Stringkey, StringsnapshotDB) {
privateStringgetValueFromSnapshotDeleteTable(Stringkey, StringsnapshotDB) {

return OMConfigKeys.OZONE_OM_DB_DIRS;
}

public static List<String> getAllColumnFamilies() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
publicstaticList<String> getAllColumnFamilies() {
/**
* Returnsalistofallcolumnfamilynamesdefinedinthedatabase.
*
* @returnlistofcolumnfamilynames
*/
publicstaticList<String> getAllColumnFamilies() {

@sadanand48
sadanand48 merged commit c706c7a into apache:masterJul 10, 2025
42 checks passed
@sadanand48

Copy link
Copy Markdown
ContributorAuthor

Thanks @jojochuang for the review.

jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Jul 31, 2025
jojochuang added a commit to jojochuang/ozone that referenced this pull request Nov 19, 2025
…n of tarball transfer. (apache#8678)"
This reverts commit c706c7a.
Conflicts:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
Change-Id: I77e2f08e4cc6b3c698387e3330985580ae117b69
jojochuang added a commit to jojochuang/ozone that referenced this pull request Nov 20, 2025
…n of tarball transfer. (apache#8678)"
This reverts commit c706c7a.
Conflicts:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
jojochuang added a commit that referenced this pull request Nov 21, 2025
…n of tarball transfer. (#8678)"
This reverts commit c706c7a.
Conflicts:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshothttps://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sadanand48@jojochuang@smengcl