Skip to content

Conversation

CTTY
Copy link
Contributor

@CTTY CTTY commented Jun 18, 2025

Which issue does this PR close?

Related issue: #1387

What changes are included in this PR?

Add a new ErrorKind : CatalogCommitConflicts for catalog to return and indicate that the operation can be retried.

Are these changes tested?

@CTTY CTTY changed the title feat(catalog): Add ErrorKind::CommitFailed feat(catalog): Add ErrorKind::CommitConflict Jun 20, 2025
@CTTY CTTY changed the title feat(catalog): Add ErrorKind::CommitConflict feat(catalog): Add ErrorKind::CommitFailed Jun 20, 2025
@CTTY CTTY force-pushed the ctty/retry-error branch from c48b14d to 77774e5 Compare June 20, 2025 23:07
liurenjie1024
liurenjie1024 previously approved these changes Jun 27, 2025
@Xuanwo
Copy link
Member

Xuanwo commented Jun 27, 2025

I actually suggest that we change the name. CommitFailed is a bit confusing and doesn't reflect what happened. How about CatalogCommitConflicts or something similar?

@liurenjie1024
Copy link
Contributor

I actually suggest that we change the name. CommitFailed is a bit confusing and doesn't reflect what happened. How about CatalogCommitConflicts or something similar?

I think this is similar to java's name convention, see https://github.com/apache/iceberg/blob/6bd6887db1f90674ca5e20e88cc95c5f92dcb050/core/src/main/java/org/apache/iceberg/BaseTransaction.java#L423
But it would be better to add some doc to explain it.

@Xuanwo
Copy link
Member

Xuanwo commented Jun 27, 2025

I think this is similar to java's name convention, see https://github.com/apache/iceberg/blob/6bd6887db1f90674ca5e20e88cc95c5f92dcb050/core/src/main/java/org/apache/iceberg/BaseTransaction.java#L423
But it would be better to add some doc to explain it.

I agree with you that following similar Java naming conventions can benefit developers coming from Java. However, having a consistent error kind naming style makes it easier for us to maintain the list and for users to use it.

I propose the name CatalogCommitConflicts for:

  • namespace: Catalog
  • action: Commit
  • reason: Conflicts

It's clean, self-descriptive, well-structured, and can easily scale to other possible error kinds.

By the way, I think XxxFailed is the most useless word in the world. Imagine encountering an error that simply says "CommitFailed": it doesn't convey any information at all. We can add in docs to tell jave developers that it's similiar to CommitFailedException

@liurenjie1024
Copy link
Contributor

I think this is similar to java's name convention, see https://github.com/apache/iceberg/blob/6bd6887db1f90674ca5e20e88cc95c5f92dcb050/core/src/main/java/org/apache/iceberg/BaseTransaction.java#L423
But it would be better to add some doc to explain it.

I agree with you that following similar Java naming conventions can benefit developers coming from Java. However, having a consistent error kind naming style makes it easier for us to maintain the list and for users to use it.

I propose the name CatalogCommitConflicts for:

  • namespace: Catalog
  • action: Commit
  • reason: Conflicts

It's clean, self-descriptive, well-structured, and can easily scale to other possible error kinds.

By the way, I think XxxFailed is the most useless word in the world. Imagine encountering an error that simply says "CommitFailed": it doesn't convey any information at all. We can add in docs to tell jave developers that it's similiar to CommitFailedException

Sounds reasonable to me.

@CTTY CTTY force-pushed the ctty/retry-error branch from 2f3e03f to 2979d56 Compare June 27, 2025 21:28
@CTTY CTTY changed the title feat(catalog): Add ErrorKind::CommitFailed feat(catalog): Add ErrorKind::CatalogCommitConflicts Jun 27, 2025
@CTTY
Copy link
Contributor Author

CTTY commented Jun 27, 2025

Hi @liurenjie1024 @Xuanwo , thanks for the vaulable inputs! I've updated the error kind name based on the suggestion, please take a look again

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

Thanks @CTTY for this pr!

@liurenjie1024
Copy link
Contributor

cc @Xuanwo to take another look.

@Xuanwo Xuanwo merged commit 46b38bb into apache:main Jun 28, 2025
17 checks passed
@CTTY CTTY deleted the ctty/retry-error branch July 1, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants