feat(#95): add Transaction::getConflictingKeyRanges() and getConflictingKeys() - #99
Merged
Merged
Conversation
5 tasks
…ingKeys() Add a typed helper to read the conflicting key ranges reported by the server after a not_committed (1020) error when TransactionOptions::setReportConflictingKeys() is enabled, without having to know the \xff\xff/transaction/conflicting_keys/ special key-space layout by hand.
s2x
force-pushed
the
feat/95-conflicting-key-ranges
branch
from
September 8, 2026 19:53
65290dd to
307e891
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #95
Summary
Adds a typed helper to read the conflicting key ranges reported by the server after a
not_committed(1020) error, whenTransactionOptions::setReportConflictingKeys()is enabled — without having to know the\xff\xff/transaction/conflicting_keys/special key-space layout by hand.Changes
Transaction::getConflictingKeys()— raw special-key rows (list<KeyValue>) with the special-key-space prefix stripped; values are"1"(range start) /"0"(range end) markers.Transaction::getConflictingKeyRanges()— pairs the markers intolist<array{begin: string, end: string}>.LogicExceptionwhen the option was not enabled on the transaction; malformed marker streams throwRuntimeException.reportConflictingKeysoption is tracked inTransaction::setOption()(also coversTransactionOptions::setReportConflictingKeys(), which routes through it).tests/Integration/ConflictingKeysTest.php: forces a write conflict between two transactions, asserts a 1020 commit failure and that a reported range covers the conflicting key.docs/error-handling.mdupdated with a usage section;CHANGELOG.mdentry added.Verification
composer lintclean (PHPCS + Rector dry-run + PHPStan level 9)composer test:unit— 480 tests OK (1 pre-existing unrelated deprecation inNativeClientPartialInitTest)