nsivabalan opened a new pull request, #11990:
URL: https://github.com/apache/hudi/pull/11990
### Change Logs
- Fix Log record reading with rollback blocks having higher timestamps
compared to maxInstant configured.
### Impact
LogRecordReader takes in a maxInstant time beyond which log blocks are
ignored. But w/ rollbacks, there are chances it could lead to data consistency
issues.
Lets go through an illustration:
Say, we have t1.dc, t2.dc and t2.dc crashed mid way.
Current layout is,
```
base file(t1), lf1(partially committed data w/ t2 as instant time)
```
Then we start t5.dc say. just when we start t5.dc, hudi detects pending
commit and triggers a rollback. And this rollback will get an instant time of
t6 (t6.rb). Note that rollback's commit time is greater than t5 or current
ongoing delta commit.
So, once rollback completes, this is the layout.
```
base file, lf1(from t2.dc partially failed), lf3 (rollback command block
with t6).
```
And once t5.dc completes, this is how the layout looks like
```
base file, lf1(from t2.dc partially failed), lf3 (rollback command block
with t6). lf4 (from t5)
```
At this point in time, when we trigger snapshot read or try to trigger
tagLocation w/ global index, maxInstant is set to last entry among commits
timeline which is t5. So, while LogRecordReader while processing all log
blocks, when it reaches lf3, it detects the timestamp of t6 > t5 (i.e max
instant time) and bails out of for loop. So, in essence it may even read lf4 in
above scenario.
This patch attempts the fix the same.
Fix:
We only hold the constraint true for any data blocks and relax it for other
block types. For eg, any data blocks > max instant time will be ignored. But
all rollback blocks are taken into consideration.
### 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]