Skip to content

Conversation

@hemanthboyina
Copy link

compute_table_stats fails with CommitFailedException when concurrent writes modify table metadata during statistics computation.

@github-actions github-actions bot added the core label Jan 26, 2026
Copy link
Contributor

@dramaticlly dramaticlly left a 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


// Skip if no changes
if (base == newMetadata) {
LOG.info("No statistics changes to commit, skipping");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think debug shall be sufficient here or we can remove it entirely.

import org.slf4j.LoggerFactory;

public class SetStatistics implements UpdateStatistics {
private static final Logger LOG = LoggerFactory.getLogger(SetStatistics.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: new line after to separate with non-static

* <p>Tests that SetStatistics properly handles concurrent modifications using retry mechanism.
*/
@ExtendWith(ParameterizedTestExtension.class)
public class TestSetStatisticsConcurrency extends TestBase {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need a new unit test ? I think we might just bring those to TestSetStatistics.java. From what I can tell, the comment in unit test is uncommon, usually assertion with assertThat().as($comments) is self-explanatory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants