codope commented on code in PR #12327:
URL: https://github.com/apache/hudi/pull/12327#discussion_r1861466555
##########
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:
That condition in `UpgradeDowngrade.needsUpgradeOrDowngrade` blocks the
pipeline and does not even let the binary to be upgraded. This change is to
facilitate migration protocol. As per the migration protocol, expectation is
users can set autoUpgrade config to false and upgrade the binary, to continue
writing in tv=6, then when all readers are upgrade, they can remove the
autoConfig override.
Recommended migration steps:
1. Stop any async table services in 0.x completely.
2. Upgrade writers to 1.x with tv=6 (this won't auto-upgrade anything); 0.x
readers will continue to work; writers can also be readers and will continue to
read both tv=6.
3. Upgrade table services to 1.x with tv=6, and resume operations.
4. Upgrade all remaining readers to 1.x, with tv=6.
5. Redeploy writers with tv=8; table services and readers will adapt/pick up
tv=8 on the fly.
--
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]