codope commented on code in PR #12327:
URL: https://github.com/apache/hudi/pull/12327#discussion_r1862654315
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/SevenToEightUpgradeHandler.java:
##########
@@ -62,19 +78,38 @@ public class SevenToEightUpgradeHandler implements
UpgradeHandler {
@Override
public Map<ConfigProperty, String> upgrade(HoodieWriteConfig config,
HoodieEngineContext context,
String instantTime,
SupportsUpgradeDowngrade upgradeDowngradeHelper) {
+ Map<ConfigProperty, String> tablePropsToAdd = new HashMap<>();
HoodieTable table = upgradeDowngradeHelper.getTable(config, context);
HoodieTableMetaClient metaClient = table.getMetaClient();
HoodieTableConfig tableConfig = metaClient.getTableConfig();
+ // If auto upgrade is disabled, set initial version and writer version to
6 and return
+ if (!config.autoUpgrade()) {
+ setInitialVersion(config, table.getMetaClient().getTableConfig(),
tablePropsToAdd);
+ config.setValue(HoodieWriteConfig.WRITE_TABLE_VERSION,
String.valueOf(HoodieTableVersion.SIX.versionCode()));
Review Comment:
1. If autoUpgrade is false, pre-table version 6, throw error to turn
autoupgrade and table version=6, to force an upgrade to 0.14/tv=6 first. And
document that users need to upgrade to 0.14/0.15 first.
2. When tv = 6 with MT, autoUpgrade is true, then upgrade to tv = 8
including MT. Assuming all readers are upgraded, this should work.
3. When tv = 6, with MT, autoUpgrade is false, then do nothing, just simple
package upgrade and continue to write in tv = 6 (without MT). And add a check
in upgrade path to later blow away MT if behind DT. Operating like this in 3,
will eventually diverge MT/DT. So during the actual upgrade, when users remove
the autoUpgrade override, MT needs to be rebuilt).
I have update the `UpgradeDowngrade.needsUpgradeOrDowngrade` and
`SevenToEightUpgradeHandler` accordingly.
--
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]