Repository navigation
fix: Stop the Couchbase online store reporting failed writes as written - #6911
Merged
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6911 +/- ##
==========================================
+ Coverage 48.04% 48.19% +0.14%
==========================================
Files 427 427
Lines 53591 53594 +3
Branches 7800 7800
==========================================
+ Hits 25749 25827 +78
+ Misses 25986 25908 -78
- Partials 1856 1859 +3
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
online_write_batch logged and skipped any upsert that raised, and still called progress for it, so materialization succeeded with rows missing from the online store. update() did the same when a scope or collection could not be created. The generic handlers now log and re-raise; the already-exists handlers are unchanged. Signed-off-by: Eric Del Orefice <114540347+ericdelorefice@users.noreply.github.com>
ntkathole
force-pushed
the
couchbase-write-errors
branch
from
October 1, 2026 04:33
4cdfc7f to
f096b89
Compare
ntkathole
approved these changes
Oct 1, 2026
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.
What this PR does / why we need it:
Problem
CouchbaseOnlineStore.online_write_batchwraps eachupsertinexcept Exception, logs it, and carries on.progress(1)still runs for the row that failed. So when Couchbase times out or rejects a write, materialization finishes normally, reports every row as written, and the online store is missing those rows.update()does the same when a scope or collection can't be created, sofeast applyalso succeeds against a store that isn't set up.The rest of the file already draws the line in the right place.
online_readcatches onlyDocumentNotFoundException, andupdate()already catchesScopeAlreadyExistsExceptionandCollectionAlreadyExistsExceptionon their own. Of the other 22 online stores, 21 have no handler around their writes and MySQL catches and re-raises, so a failed write reaches the caller everywhere else.Reproduction
A mocked collection whose
upsertraisesTimeoutException, onmaster.online_write_batchwith three rows logs three errors and returns normally:No exception reaches the caller, and
progressis called three times.Change
The three generic handlers keep their log line and
raise. The "already exists" handlers and the read path are unchanged, so re-runningfeast applyagainst an existing scope and collection still works.Verification
New
tests/unit/infra/online_store/test_couchbase_online_store.py, 5 tests. With the source reverted tomasterand the tests kept, 3 fail: the write, the scope and the collection cases. The 2 that pass are the controls, a normal write and an already-existing scope and collection, which behave the same before and after.The rest of
tests/unit/infra/online_storegives the same result with and without this change.ruff checkandruff format --checkare clean.Which issue(s) this PR fixes:
None filed. The reproduction is above.
Checks
git commit -s)Testing Strategy
Misc
The store is marked alpha, so I kept this to the error handling and left everything else alone.