echonesis commented on PR #9689: URL: https://github.com/apache/ozone/pull/9689#issuecomment-3845232656
> > ... there's an upgrade scenario I'd like to clarify ... > > Thanks for pointing out the upgrade scenario. The `initializeRatis(..)` does not auto-create directories. When the directories are created for upgrade? > > We probably should have --upgrade option. Any "auto-create directories" behavior is error prone and leads to data loss. In `initializeRatis()` (StorageContainerManager.java L1354-L1358), I added explicit creation of snapshotDir: ```java String snapshotDir = SCMHAUtils.getSCMRatisSnapshotDirectory(conf); HddsUtils.createDir(snapshotDir); ``` For `ratisStorageDir`, it's auto-created by Ratis internally when `SCMRatisServerImpl.initialize()` calls `RaftServer.build()`. The upgrade scenario (L376-378) calls `initializeRatis()` during normal startup when `!isSCMHAEnabled()`, which triggers both directory creations. I agree that adding an `--upgrade` option would be a cleaner approach. -- 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]
