Uh oh!
There was an error while loading. Please reload this page.
HDDS-14859. Use RocksDb secondary instance for validating volumes. - #9947
Conversation
errose28
commented
Mar 18, 2026
Thanks for looking into this @ptlrs. I think we may want to use a secondary instance instead of a read-only instance for this check. It looks like it will meet the same goal of reading CURRENT and MANIFEST files, but will only fail if the DB is truly in bad health. We will need to provide it a directory to write its own log files, but we can use the volume's specific |
ptlrs
commented
Mar 18, 2026
Thanks for taking a look @errose28. Using secondary instance had crossed my mind while writing this PR but that page was the reason I didn't make the change. In fact I saw this comment in a different discussion which says:
So based on the documentation and the comment, to me it appears that unless you actually perform any reads in RO mode, there won't be a problem. We don't perform any reads during the volume check but RocksDb does read the metadata from the footer of all SST files as well the MANIFEST files and the WAL when it is opened in RO mode. If that is where the problem is then, not sure if using a secondary instance would solve our problem. Secondary instance appears to be the same as RO instance with the extra capability of bringing the instance upto speed with the RW instance using a manual command invocation. I don't mind changing to secondary instance, as at worst we would get the same behavior but it would be good to brainstorm what could be the differences. |
errose28
commented
Mar 19, 2026
@ptlrs the main documentation is unfortunately vague here, but there's also this excerpt from the FAQ:
In our case we are only using one process with multiple handles. However, since writes will be going to the DB as we are checking the volume, this seems to indicate that secondary instance is still what we want to use here. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ptlrs
commented
Mar 24, 2026
I have updated the PR to use a secondary RocksDb instance instead of a read-only instance |
ptlrs
commented
Mar 26, 2026
Hi @errose28@ChenSammi@yandrey321, I have pushed some updates to this PR. Could you please take another look at it. |
ss77892
commented
Mar 30, 2026
So, we know for sure that openReadOnly might fail due to some internal work performed by RocksDB (like if there was log rotation in the middle, it might fail with FNF exception). Does opening as a secondary suffer from the same problems? If not, do we really need a secondary check? If it is, then how do we know that there will be no such failure during the second check? |
ptlrs
commented
Mar 31, 2026
@ss77892 you are right, we don't know if secondary instance will face the same fate. There is no documentation which clearly says that secondary instance behaves differently from RO instance when it comes to opening a new instance. The core contribution of this PR is attempting to open a db twice before declaring failure. We can update the PR to make the choice between RO and secondary instance configurable if we think such a fallback would be helpful here. |
errose28
commented
Mar 31, 2026
I think the excerpt from the FAQ I mentioned in this comment is sufficient to indicate that secondary is expected to open cleanly while writes are ongoing and read-only is not. Whether the phrasing they've used is "clear" is debatable, and it would be nice if this was in the official doc page for the feature and not the FAQ. However from my point of view this is sufficient to design this around the assumption that secondary is expected to open cleanly while writes are happening unless the global DB files are corrupted or there is a transient IO error, which our sliding windows account for. |
ss77892
commented
Mar 31, 2026
|
ptlrs
commented
Mar 31, 2026
@errose I would not infer "secondary is expected to open cleanly" based just on that FAQ. @ss77892 In RO/Secondary mode, the SST files are opened and their metadata is checked. Each SST file's footer, metaindex blocks, properties block are read. No data related checks are performed though. So integrity and correctness of the SST files is partially present but not for the main contents of the SST file. |
ptlrs
commented
Apr 3, 2026
Hi @yandrey321@ChenSammi@ss77892@errose28, is there anything else we would like to update for this PR? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It seems that this statement is not correct. I just checked the open RO with strace, and it doesn't touch sst files at all: So, opening it RO looks quite useless because it reads the metadata and logs only, and wastes CPU reading log files into the memory. |
…-14859-Ignore-transient-errors-while-validating-RocksDb-on-volumes # Conflicts: # hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeConfiguration.java # hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java
ptlrs
commented
Apr 21, 2026
Hi @yandrey321@ChenSammi@ss77892@errose28, can I get a review for this PR? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rpatel@GQ2V5HK6NX disk-check % pwd
/Users/rpatel/Github/ozone/hadoop-ozone/integration-test/target/test-dir/MiniOzoneClusterImpl-ad36e20c-8035-4944-a3f3-0c81241cd28f/ozone-metadata/datanode-1/data-0/hdds/ad36e20c-8035-4944-a3f3-0c81241cd28f/tmp/disk-check
rpatel@GQ2V5HK6NX disk-check % ls -alht
total 24
-rw-r--r--@ 1 rpatel staff 9.5K Apr 27 20:21 LOG
drwxr-xr-x@ 3 rpatel staff 96B Apr 27 20:21 .
drwxr-xr-x@ 4 rpatel staff 128B Apr 27 20:21 ..
|
errose28
left a comment
There was a problem hiding this comment.
Thanks for working on this. The DB checks are called after an initial available space check, but should we also double check the available space in the DB health check if the open fails, since it will be writing a LOG file?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ptlrs
commented
May 8, 2026
Hi @ChenSammi@errose28@yandrey321@ss77892, can I please get a review for this? |
ptlrs
commented
May 15, 2026
Hi @ChenSammi@errose28@yandrey321@ss77892, could you please take another look? |
errose28
left a comment
There was a problem hiding this comment.
Just a few minor comments left. Looks good otherwise.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…-14859-Ignore-transient-errors-while-validating-RocksDb-on-volumes
Uh oh!
There was an error while loading. Please reload this page.
…on in RocksDB health checks.
ptlrs
commented
Jun 15, 2026
Uh oh!
There was an error while loading. Please reload this page.
…ozone/container/common/volume/HddsVolume.java Co-authored-by: Siyao Meng <50227127+smengcl@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Merged. Thanks @errose28@yandrey321@ChenSammi@ss77892 for the reviews. Thanks @ptlrs for the patch. |
ptlrs
commented
Jun 17, 2026
Thanks for the extensive reviews @errose28@smengcl@ss77892@ChenSammi@yandrey321 |
What changes were proposed in this pull request?
In the volume scanner, we open the RocksDb that is present on each volume.
There could be errors when opening this RocksDb in readonly mode.
The volume scanner should instead open the RocksDb as a secondary instance.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14859
How was this patch tested?
https://github.com/ptlrs/ozone/actions/runs/23264628727