-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-13228. Take snapshot cache lock during the last iteration of tarball transfer. #8678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
Outdated
Show resolved
Hide resolved
...n-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java
Show resolved
Hide resolved
...ne-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java
Outdated
Show resolved
Hide resolved
| LOG.warn("SnapshotId: '{}' does not exist in snapshot cache.", k); | ||
| } else { | ||
| try { | ||
| v.get().getMetadataManager().getStore().flushDB(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
jojochuang
left a comment
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| String getValueFromSnapshotDeleteTable(String key, String snapshotDB) { | |
| private String getValueFromSnapshotDeleteTable(String key, String snapshotDB) { |
| return OMConfigKeys.OZONE_OM_DB_DIRS; | ||
| } | ||
|
|
||
| public static List<String> getAllColumnFamilies() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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() { |
|
Thanks @jojochuang for the review. |
…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
…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
…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
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