Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ARCTIC-994] fix read legacy transaction id when MOR #1058

Merged
merged 5 commits into from
Feb 9, 2023

Conversation

wangtaohz
Copy link
Contributor

@wangtaohz wangtaohz commented Feb 6, 2023

Why are the changes needed?

Now, the transaction ids of each partition are stored in the base table's property, and the legacy transaction id is supposed to be read when the transaction id is not present, in order to be compatible with the legacy tables from 0.3.*.

However, when the transaction id is not present, we return -1, which is error-prone, and causes compatibility problem for MOR.

Brief change log

  • return null instead of -1 when transaction id is not present.
  • refactor OverwriteBaseFiles when handling transaction id
  • for data consistency, allow KeyedPartitionRewrite to set the transaction id to a smaller value

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduces a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@github-actions github-actions bot added the module:core Core module label Feb 6, 2023
}

for (DataFile d : this.deleteFiles) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't this this.deleteFiles should be handled here, so I remove these code

@wangtaohz
Copy link
Contributor Author

@github-actions github-actions bot added module:ams-server Ams server module module:ams-dashboard Ams dashboard module module:mixed-hive Hive moduel for Mixed Format module:mixed-spark Spark module for Mixed Format labels Feb 8, 2023
@zhoujinsong zhoujinsong merged commit e88a0e5 into apache:master Feb 9, 2023
@wangtaohz wangtaohz deleted the fix-994-3 branch February 9, 2023 01:59
wangtaohz added a commit that referenced this pull request Feb 9, 2023
* if max-txId is not present, return null instead of -1 to be compatible with legacy txId

* refactor and simplify OverwriteBaseFiles with transaction id

* KeyedPartitionRewrite allow to set transactionId with a smaller value

* refactor name to updateMaxTransactionIdDynamically

* modify check this.dynamic != null

(cherry picked from commit e88a0e5)
Signed-off-by: wangtao <wangtao3@corp.netease.com>
zhoujinsong pushed a commit that referenced this pull request May 31, 2023
* if max-txId is not present, return null instead of -1 to be compatible with legacy txId

* refactor and simplify OverwriteBaseFiles with transaction id

* KeyedPartitionRewrite allow to set transactionId with a smaller value

* refactor name to updateMaxTransactionIdDynamically

* modify check this.dynamic != null
ShawHee pushed a commit to ShawHee/arctic that referenced this pull request Dec 29, 2023
* if max-txId is not present, return null instead of -1 to be compatible with legacy txId

* refactor and simplify OverwriteBaseFiles with transaction id

* KeyedPartitionRewrite allow to set transactionId with a smaller value

* refactor name to updateMaxTransactionIdDynamically

* modify check this.dynamic != null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:ams-dashboard Ams dashboard module module:ams-server Ams server module module:core Core module module:mixed-hive Hive moduel for Mixed Format module:mixed-spark Spark module for Mixed Format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants