-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: Fix compute_table_stats failures with concurrent writes #15148
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
base: main
Are you sure you want to change the base?
Conversation
dramaticlly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shall add commit retry like other PendingUpdate implementation class, RemoveSnapshots is a good example. But we can probably simplify the unit test a bit
dramaticlly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@huaxingao @nastra I think this one is close, can you take a look as well? |
| 2.0 /* exponential */) | ||
| .onlyRetryOn(CommitFailedException.class) | ||
| .run( | ||
| item -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: item is not used
| TableMetadata newMetadata = internalApply(base); | ||
| ops.commit(base, newMetadata); | ||
| Tasks.foreach(ops) | ||
| .retry(base.propertyAsInt(COMMIT_NUM_RETRIES, COMMIT_NUM_RETRIES_DEFAULT)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retry config is pulled from base initialized at construction time. If table properties change between construction and commit(), retries won’t pick that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of adding a member variable base, could we simplify by using local base/updated variables per retry attempt (base = taskOps.refresh(); updated = internalApply(base); taskOps.commit(base, updated))?
compute_table_stats fails with CommitFailedException when concurrent writes modify table metadata during statistics computation.