← 输入框|github.com|刷新
Skip to content

Clarify the comments on retried transaction commits - #7822

Merged
blp merged 2 commits into
mainfrom
commit-transaction-docs
Nov 4, 2026
Merged

blp merged 2 commits into
mainfrom
commit-transaction-docs

Conversation

@blp

@blp blp commented Nov 3, 2026

Copy link
Copy Markdown
Member

Comments only, in crates/connectors/src/controller.rs. Review of feldera/cloud#2135 found them unclear, and that PR copied them from #7687.

Comment Change
TransactionInfo::last_api_commit "This is not any transaction up to last_transaction_id" now says that a request that names another earlier transaction fails, and why.
5 tests in commit_transaction_id_tests Each comment starts with "Checks that", so it does not read like a description of a function's result.

No code changes.

The comment on `last_api_commit` said "This is not any transaction up to
`last_transaction_id`", which did not say what it meant.  The test
comments read like descriptions of a function's result.  Now each test
comment starts with "Checks that".  Review of feldera/cloud#2135 found
the same text there.

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp requested a review from mihaibudiu November 3, 2026 23:13
@blp blp self-assigned this Nov 3, 2026
@blp blp added QA Testing and quality assurance rust Pull requests that update Rust code labels Nov 3, 2026
Comment on lines +7476 to 7479
/// retry of that request succeeds without doing anything. A request that
/// names another transaction up to `last_transaction_id` fails, because
/// that transaction can be an automatic or connector transaction, or one
/// that a restart lost.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pitfall (medium): This doesn't match start_commit_transaction_from_api. The open API transaction is also "another transaction up to last_transaction_id", and a commit that names it succeeds. The stated reason is also incomplete: an older transaction that the API itself committed also fails, because only the most recent commit is remembered. The PR description says "another earlier transaction", but the comment doesn't. Suggested wording:

Suggested change
/// retry of that request succeeds without doing anything. A request that
/// names another transaction up to `last_transaction_id` fails, because
/// that transaction can be an automatic or connector transaction, or one
/// that a restart lost.
/// retry of that request succeeds without doing anything. A request that
/// names any other transaction, except the one that the API has open,
/// fails. We can't accept every ID up to `last_transaction_id`, because
/// that ID can belong to an automatic or connector transaction, or to one
/// that a restart lost.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2e17784. I used your wording and added that an older API commit also fails, because only the last one is kept.

(Reply from Claude, on behalf of @blp.)

@mythical-fred-oss

Copy link
Copy Markdown
Contributor

Only comments change here, so no gates apply: behaviour, tests, docs and dependencies are untouched.

Ran Result
cargo test --locked -p dbsp_connectors --lib commit_transaction_id_tests 5/5 pass
pre-commit run --files crates/connectors/src/controller.rs pass
  • pitfall (medium): the new last_api_commit comment says something the code doesn't do (see the inline comment). Otherwise LGTM, and the "Checks that…" test comments read well.

The comment said that a commit of any other transaction up to
`last_transaction_id` fails, but a commit of the open API transaction
succeeds.  It also did not say that a retry of an older API commit
fails.  Found in review.

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 79f0d30 Nov 4, 2026
1 check passed
@blp
blp deleted the commit-transaction-docs branch November 4, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Testing and quality assurance rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants