yihua commented on code in PR #8771:
URL: https://github.com/apache/hudi/pull/8771#discussion_r1199676834
##########
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:
Upgrade and downgrade do not do any write or cleaning so the
`HoodieFailedWritesCleaningPolicy` is not used. For consistency, yeah, I
changed it to eager.
--
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]