codope opened a new pull request, #12224:
URL: https://github.com/apache/hudi/pull/12224
### Change Logs
After debugging, I found that upgrade path is invoked but the `metaClient`
is not reloaded after that. Simply reloading in `tryUpgrade` is not enough
because we call that in a lambda. So, this PR fixes the issue as follows:
- Updated `doInitTable()` to return the potentially reloaded `metaClient`,
allowing `initTable()` to access the updated `metaClient` reference after an
upgrade.
- Utilized `AtomicReference` in `doInitTable()` to enable reassignment
within lambda expressions, satisfying Java’s "effectively final" requirement
for lambda variables.
- Enhanced `HoodieCommitMetadata.fromBytes()` method with a fallback
mechanism for JSON deserialization given that commit metadata serialization
changed from json to avro in 1.0.
Tested manually by running the same steps as mentioned in HUDI-8395.
### Impact
Refactor metaClient handling during upgrade/downgrade, and implement
fallback in JSON deserialization.
### Risk level (write none, low medium or high below)
medium
### Documentation Update
_Describe any necessary documentation update if there is any new feature,
config, or user-facing change. If not, put "none"._
- _The config description must be updated if new configs are added or the
default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website.
Please create a Jira ticket, attach the
ticket number here and follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website) to
make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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]