nsivabalan commented on code in PR #8771: URL: https://github.com/apache/hudi/pull/8771#discussion_r1199694422
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngrade.java: ########## @@ -105,6 +108,25 @@ public boolean needsUpgradeOrDowngrade(HoodieTableVersion toVersion) { * @param instantTime current instant time that should not be touched. */ public void run(HoodieTableVersion toVersion, String instantTime) { + // Change metadata table version automatically + if (toVersion.versionCode() >= HoodieTableVersion.FOUR.versionCode()) { + String metadataTablePath = HoodieTableMetadata.getMetadataTableBasePath( + metaClient.getBasePathV2().toString()); + try { + if (metaClient.getFs().exists(new Path(metadataTablePath))) { + HoodieTableMetaClient mdtMetaClient = HoodieTableMetaClient.builder() + .setConf(metaClient.getHadoopConf()).setBasePath(metadataTablePath).build(); + HoodieWriteConfig mdtWriteConfig = HoodieBackedTableMetadataWriter.createMetadataWriteConfig( + config, HoodieFailedWritesCleaningPolicy.LAZY); Review Comment: gotcha. -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org