ptlrs commented on PR #9947: URL: https://github.com/apache/ozone/pull/9947#issuecomment-4346456680
@ChenSammi 1. We use SecondaryInstance mode because ReadOnly mode is not supposed to be used if the DB has already been opened via Read-Write mode. ReadOnly mode can have [undefined behaviour]( https://github.com/facebook/rocksdb/blob/c28b4f0e126da7693f04b9dceda74ccc90614a9b/include/rocksdb/db.h#L167-L171) >if a DB is simultaneously opened by Open and OpenForReadOnly, the read-only instance has undefined behavior (though can often succeed if quickly closed) 2. Secondary instances [won't duplicate](https://github.com/facebook/rocksdb/wiki/Read-only-and-Secondary-instances) any files in its directory. >The Read-only/Secondary instances opens all files in the primary DB Path in read-only mode and never creates any new files in that directory 3. The TryCatchUpWithPrimary is a user triggered operation. It does not run automatically ever. When it catches up with new data, it only rebuilds the memtable and does not write any new data. Since we don't read any keys from the secondary instance, we are not concerned with this functionality and we will not call this method. 4. Secondary instance requires an extra directory but that directory is only for saving RocksDb log files. The log files are rotated each time a secondary instance is opened. It does not store any important data. 5. I have updated the PR to remove these log files every time after closing the secondary instance -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
