Skip to content

Conversation

@vamsikarnika
Copy link
Collaborator

@vamsikarnika vamsikarnika commented Oct 27, 2025

Describe the issue this Pull Request addresses

Fixes an issue where MDT partitions were being unintentionally deleted during downgrade operations

Summary and Changelog

Downgrade operation doesn't drop any partitions.

Impact

MDT partitions are not deleted during downgrade/upgrade operation

Risk Level

low

Documentation Update

NA

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

@vamsikarnika vamsikarnika marked this pull request as draft October 27, 2025 04:05
@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Oct 27, 2025
@github-actions github-actions bot added size:M PR with lines of changes in (100, 300] and removed size:S PR with lines of changes in (10, 100] labels Oct 27, 2025
@nsivabalan
Copy link
Contributor

PR desc please

+ " or when using a custom Hoodie Concat Handle Implementation controlled by the config " + CONCAT_HANDLE_CLASS_NAME.key()
+ ", enabling this config results in fallback to the default implementations if instantiation of the custom implementation fails");

public static final ConfigProperty<Boolean> AUTO_DETECT_AND_DELETE_MDT_PARTITIONS = ConfigProperty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not end user config. we should remove this. we just need it as an additional argument to method calls. those originating from downgrade, dropIndex apis should set the argument value to false.
rest of the callers should leave it as true

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code path causing the issue is getting called from multiple places in the Upgrade/Downgrade code path which is making the approach of using additional argument to method calls very cumbersome.

For e.g rollbackFailedWritesAndCompact during downgrade also calls tableMetadata.getMetadataWriter which is the method that's causing the issue

val cowTableName = "hudi-v9-table-mdt-validation-cow"
val morTableName = "hudi-v9-table-mdt-validation-mor"

val cowTableBasePath = basePath + "/" + cowTableName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you help me remind why do we need a test fixture for this?
a functional test should suffice right?
we can create a v9 table and then downgrade to v8. and just validate the MDT partitions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, fixed the test

@nsivabalan
Copy link
Contributor

also, why the patch is in draft state?

@nsivabalan
Copy link
Contributor

also, looks like you need to check CI failures as well.

@yihua yihua added this to the release-1.1.0 milestone Oct 27, 2025
@vamsikarnika vamsikarnika changed the title fix: delete rli partitions during table downgrade fix: Fix downgrade to not delete unintended partitions in MDT Oct 27, 2025
@vamsikarnika vamsikarnika marked this pull request as ready for review October 27, 2025 19:39
@vamsikarnika
Copy link
Collaborator Author

also, why the patch is in draft state?

Made it ready for review, was working on UT

@vamsikarnika vamsikarnika changed the title fix: Fix downgrade to not delete unintended partitions in MDT fix: fix downgrade to not delete unintended partitions in MDT Oct 27, 2025
@vamsikarnika vamsikarnika force-pushed the fix_rli_delete_partitions branch from 8f3c2c2 to 11b94c6 Compare October 27, 2025 20:16
@nsivabalan nsivabalan force-pushed the fix_rli_delete_partitions branch from 104cfdb to 64b6e81 Compare October 27, 2025 23:46
@nsivabalan
Copy link
Contributor

reviewed, pushed out a commit to address my own feedback.
LGTM

@nsivabalan
Copy link
Contributor

pushed another commit to remove the new write config and use arguments.

@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@nsivabalan
Copy link
Contributor

image

@nsivabalan nsivabalan merged commit 1313b39 into apache:master Oct 28, 2025
135 of 137 checks passed
yihua pushed a commit that referenced this pull request Oct 28, 2025
---------

Co-authored-by: Vamsi <vamsi@onehouse.ai>
Co-authored-by: sivabalan <n.siva.b@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.1.0 size:M PR with lines of changes in (100, 300]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants