Skip to content

Conversation

@sadanand48
Copy link
Contributor

@sadanand48 sadanand48 commented Jun 23, 2025

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

@sadanand48 sadanand48 added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Jun 23, 2025
@jojochuang jojochuang requested review from smengcl and swamirishi June 23, 2025 23:00
@sadanand48 sadanand48 marked this pull request as ready for review June 26, 2025 06:13
@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
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

Copy link
Contributor Author

@sadanand48 sadanand48 Jul 8, 2025

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.

Copy link
Contributor

@jojochuang jojochuang left a comment

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
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
Contributor

Choose a reason for hiding this comment

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

Suggested change
String getValueFromSnapshotDeleteTable(String key, String snapshotDB) {
private String getValueFromSnapshotDeleteTable(String key, String snapshotDB) {

return OMConfigKeys.OZONE_OM_DB_DIRS;
}

public static List<String> getAllColumnFamilies() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public static List<String> getAllColumnFamilies() {
/**
* Returns a list of all column family names defined in the database.
*
* @return list of column family names
*/
public static List<String> getAllColumnFamilies() {

@sadanand48 sadanand48 merged commit c706c7a into apache:master Jul 10, 2025
42 checks passed
@sadanand48
Copy link
Contributor Author

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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot https://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants