ivandika3 commented on code in PR #8818:
URL: https://github.com/apache/ozone/pull/8818#discussion_r2214651102
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/TransactionInfoRepair.java:
##########
@@ -65,12 +68,16 @@ public class TransactionInfoRepair extends RepairTool {
@Override
public void execute() throws Exception {
+ ManagedConfigOptions configOptions = new ManagedConfigOptions();
+ ManagedDBOptions dbOptions = new ManagedDBOptions();
List<ColumnFamilyHandle> cfHandleList = new ArrayList<>();
- List<ColumnFamilyDescriptor> cfDescList =
RocksDBUtils.getColumnFamilyDescriptors(
- dbPath);
+ List<ColumnFamilyDescriptor> cfDescList = new ArrayList<>();
String columnFamilyName = getColumnFamily(serviceToBeOffline()).getName();
- try (ManagedRocksDB db = ManagedRocksDB.open(dbPath, cfDescList,
cfHandleList)) {
+ // Preserve all the previous DB options
+ OptionsUtil.loadLatestOptions(configOptions, dbPath, dbOptions,
cfDescList);
Review Comment:
@swamirishi Thanks for the review. That was my first approach. However, this
approach means that the repair tool implementation needs to be coupled with
`DBStoreBuilder` implementation. These have a few possible problems:
- Currently the `DBStoreBuilder.rocksDBOption` is not set and there will use
`DBStoreBuilder#getDefaultDB` which will try to get some options from `.ini`
files configured. If for example, we move the RocksDB to another machine and
try to compact it there, we also need to have these `.ini` files.
- `defaultCfProfile` is governed by `hdds.db.profile` which defaults to
`DISK`, if OM / SCM overrides these configuration and OM DB was again moved to
another machine to be compacted, it will requires these `hdds.db.profile`.
So to prevent these coupling and options overwrite, we should simply use
`OptionUtil#loadLatestOptions`.
--
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]