-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-11068. Move SstFiltered flag to a file in the snapshot directory #6965
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
Change-Id: I9e16fe4b117c232423c1d2de3f48d99acb71827f
Change-Id: I36cee730a30496264b32c74a5f25ae2e92936eba
|
Please wait for clean CI run in fork before opening PR. |
Change-Id: If23d180a31439cb2338fc852f8515dd6422aa1a6
Change-Id: Id5e3ae98555b3102e24bdfb3fb38e2e7e24c26a8
Yeah I forgot to switch it to draft. |
hemantk-12
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.
Thanks for the patch @swamirishi
Overall patch looks good to me. Left some minor comments and suggestions.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java
Outdated
Show resolved
Hide resolved
...ne-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestSnapshotDeletingService.java
Outdated
Show resolved
Hide resolved
| snapshotLimit--; | ||
| snapshotFilteredCount.getAndIncrement(); | ||
| } catch (RocksDBException | IOException e) { | ||
| LOG.error("Exception encountered while filtering a snapshot", e); |
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.
nit: should we log it at an info level, if SstFileringService fails because the snapshot is purged? Otherwise, it will be unnecessary noisy logs.
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.
You cannot be sure why the issue occured. RocksDbException can thrown for many reasons. One of them being the db being closed by another thread.
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.
Yes, that's why I asked to log it at the info level if it fails because snapshot dir doesn't exist which will be the case when it is purged. RocksDB throws exception like org.rocksdb.RocksDBException: While mkdir if missing: path_to_db_dir: No such file or directory..
Change-Id: I438ede5cd999cb991064cf9f4bf142568b03f98f
| private static final int SST_FILTERING_CORE_POOL_SIZE = 1; | ||
|
|
||
| public static final String SST_FILTERED_FILE = "sstFiltered"; | ||
| private static final byte[] SST_FILTERED_FILE_CONTENT = StringUtils.string2Bytes("This directory holds information " + |
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.
| private static final byte[] SST_FILTERED_FILE_CONTENT = StringUtils.string2Bytes("This directory holds information " + | |
| private static final byte[] SST_FILTERED_FILE_CONTENT = StringUtils.string2Bytes("This file holds information " + | |
| "if a particular snapshot has filtered out the irrelevant sst files or not.\nDO NOT add, change or delete " + | |
| "this file unless you know what you are doing.\n"); |
| // multiple times. | ||
| private static final int SST_FILTERING_CORE_POOL_SIZE = 1; | ||
|
|
||
| public static final String SST_FILTERED_FILE = "sstFiltered"; |
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.
nit: should we have .txt or any other text file extension?
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java
Outdated
Show resolved
Hide resolved
| snapshotLimit--; | ||
| snapshotFilteredCount.getAndIncrement(); | ||
| } catch (RocksDBException | IOException e) { | ||
| LOG.error("Exception encountered while filtering a snapshot", e); |
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.
Yes, that's why I asked to log it at the info level if it fails because snapshot dir doesn't exist which will be the case when it is purged. RocksDB throws exception like org.rocksdb.RocksDBException: While mkdir if missing: path_to_db_dir: No such file or directory..
...ager/src/main/java/org/apache/hadoop/ozone/om/response/snapshot/OMSnapshotPurgeResponse.java
Outdated
Show resolved
Hide resolved
Change-Id: I373acfefbf65812665794dfeb292a928900b6c73
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java
Show resolved
Hide resolved
| public static final String SST_FILTERED_FILE = "sstFiltered"; | ||
| private static final byte[] SST_FILTERED_FILE_CONTENT = StringUtils.string2Bytes("This file holds information " + | ||
| "if a particular snapshot has filtered out the relevant sst files or not.\nDO NOT add, change or delete " + | ||
| "any files in this directory unless you know what you are doing.\n"); |
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.
| "any files in this directory unless you know what you are doing.\n"); | |
| "this file unless you know what you are doing.\n"); |
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 file is inside the rocksdb directory. The statement is correct right isn't? Basically asking people not to change any file in this directory.
hemantk-12
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.
LGTM
Change-Id: I73029fede1d667b70c68c11527398216e458f8ae
|
Thank you for reviewing the patch @hemantk-12 |
…apache#6965) (cherry picked from commit 1ae2701)
…apache#6965) (cherry picked from commit 1ae2701)
…apache#6965) (cherry picked from commit 1ae2701)
…ot directory (apache#6965) (cherry picked from commit 1ae2701) Change-Id: I176724d052cbca8f345d471683320f131222982f
What changes were proposed in this pull request?
SstFiltering service directly updates the snapshotInfo and doesn't go through DoubleBufferFlush to update the DB. This interferes with SnapshotInfo updated during SnapshotPurgeRequest.
Consider the case:
S1 <- S2(SstFiltered) <- S3 (Sst unfiltered)
At T1 if S2 is purged and submitted to OM ratis but it hasn't been flushed to the rocksDb but just present in the cache which makes the chain.
S1 <- S3 (Sst Unfiltered in cache)
S2(SstFiltered, deleted in Cache but present in table)
Suppose at T2 SstFiltering service runs on the chain and marks S3 to be SstFiltered which would be directly flushed to DB
S1 <- S3 (Sst filtered in DB)
S1 <- S2 (Present in DB but not present in cache)
Now if the OM is restarted, snapshot chain would have gotten corrupted since both S2 & S3 are pointing S1 in the DB.
Changes made in the patch:
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11068
How was this patch tested?
Unit tests