nsivabalan commented on code in PR #12327:
URL: https://github.com/apache/hudi/pull/12327#discussion_r2231815248
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/SevenToEightUpgradeHandler.java:
##########
@@ -91,33 +142,33 @@ public Map<ConfigProperty, String>
upgrade(HoodieWriteConfig config, HoodieEngin
ActiveTimelineV2 activeTimelineV2 = new ActiveTimelineV2(metaClient);
context.map(instants, instant -> {
String originalFileName =
instantFileNameGenerator.getFileName(instant);
- String replacedFileName = originalFileName;
- boolean isCompleted = instant.isCompleted();
- // Rename the metadata file name from the
${instant_time}.action[.state] format in version 0.x
- // to the ${instant_time}_${completion_time}.action[.state] format in
version 1.x.
- if (isCompleted) {
- String completionTime = instant.getCompletionTime(); // this is the
file modification time
- String startTime = instant.requestedTime();
- replacedFileName = replacedFileName.replace(startTime, startTime +
UNDERSCORE + completionTime);
- }
- // Rename the action if necessary (e.g., REPLACE_COMMIT_ACTION to
CLUSTERING_ACTION).
- // NOTE: New action names were only applied for pending instants.
Completed instants do not have any change in action names.
- if (SIX_TO_EIGHT_TIMELINE_ACTION_MAP.containsKey(instant.getAction())
&& !isCompleted) {
- replacedFileName = replacedFileName.replace(instant.getAction(),
SIX_TO_EIGHT_TIMELINE_ACTION_MAP.get(instant.getAction()));
- }
- try {
- return renameTimelineV1InstantFileToV2Format(instant, metaClient,
originalFileName, replacedFileName, commitMetadataSerDeV1,
commitMetadataSerDeV2, activeTimelineV2);
- } catch (IOException e) {
- LOG.warn("Can not to complete the upgrade from version seven to
version eight. The reason for failure is {}", e.getMessage());
- }
- return false;
+ return upgradeActiveTimelineInstant(instant, originalFileName,
metaClient, commitMetadataSerDeV1, commitMetadataSerDeV2, activeTimelineV2);
}, instants.size());
}
+ upgradeToLSMTimeline(table, context, config);
+
return tablePropsToAdd;
}
- private static void upgradePartitionFields(HoodieWriteConfig config,
HoodieTableConfig tableConfig, Map<ConfigProperty, String> tablePropsToAdd) {
+ private static boolean isMetadataTableBehindDataTable(HoodieWriteConfig
config, HoodieTableMetaClient metaClient) {
Review Comment:
do we know how we might end up in this situation?
this can only happen if the latest write succeeded in mdt, but failed in dt.
--
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]