Repository navigation
fix(databases): queued batches of differing nullability combine on a connector database (ITL-1381) #539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
eywalker
wants to merge
18
commits into
main
Choose a base branch
from
eywalker/itl-1381-connector-database-a-read-before-flush
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
fix(databases): queued batches of differing nullability combine on a connector database (ITL-1381) #539
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9c08ddc
fix(databases): queued batches of differing nullability combine on a …
eywalker f8cc492
fix(databases): refuse a queued batch that loosens a stored NOT NULL …
eywalker e2966a6
fix(databases): check queued rows against their own declared nullabil…
eywalker 369b777
fix(databases): the declared-null rule looks inside map keys (ITL-1381)
eywalker 74eafc4
fix(databases): check declared nulls before the rows are normalized (…
eywalker 0794ee9
Merge remote-tracking branch 'origin/main' into eywalker/itl-1381-con…
eywalker 4f2c354
fix(databases): retain queued rows when a connector flush fails (ITL-…
eywalker 60b624a
fix(databases): make SQLite upserts atomic and isolate rejected rows …
eywalker 48c779c
fix(databases): isolate connector writes after unlocated row refusals…
eywalker a4a2524
fix(databases): preserve isolated SQLite writes and their dependents …
eywalker 0554fcf
Merge remote-tracking branch 'origin/main' into eywalker/itl-1381-con…
eywalker 992388a
fix(databases): discard and report refused connector batches (ITL-1381)
eywalker 744be4a
fix(databases): scope SQLite upsert conflicts to the record id (ITL-1…
eywalker 7d2c26b
fix(databases): flush each write policy separately; never replay an i…
eywalker 2238ac2
fix(databases): keep unsent policy batches queued and checked; requir…
eywalker cae3ae7
fix(databases): replace a table's queued rows and ids in one step (IT…
eywalker d312eba
fix(databases): take a batch out of the queue before its write is tri…
eywalker 4c5bdf7
test(databases): note why the line-trace test interrupts between stat…
eywalker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ### Fixed | ||
|
|
||
| - A writable connector database no longer fails with `ArrowInvalid` | ||
| when rows are queued for a table whose queued rows declare a column's nullability | ||
| differently. The combined batch declares the column nullable. Combining declarations | ||
| that disagree on a stored `NOT NULL` column is still refused. Queuing a null in a | ||
| stored `NOT NULL` column is also refused, regardless of the incoming declaration. | ||
| Rows holding a null where their own schema declares a column or nested field non-nullable | ||
| raise `NullInNonNullableColumnError` when they are queued, before anything is stored. | ||
| A SQLite upsert rolls back the whole attempted batch on failure. A failed flush | ||
| removes that batch and records guarded by its results. The error reports each | ||
| affected table, every removed key, and the database's reason. Other tables can | ||
| still commit. PostgreSQL rejects text containing NUL at enqueue. When two | ||
| handles update the same key, the last flush to commit that key wins. | ||
| (ITL-1381) | ||
| - A SQLite connector handles a conflict on the record id only, as PostgreSQL does | ||
| (`ON CONFLICT (<id>) DO NOTHING` or `DO UPDATE`). A `CHECK` violation is no longer | ||
| dropped silently with `skip_duplicates`, and a collision on another `UNIQUE` column | ||
| raises instead of deleting the other row. A row skipped because its id exists is | ||
| not checked further. `SQLiteConnector` now needs SQLite 3.24.0 or newer and refuses | ||
| an older library when it is built. (ITL-1490) | ||
| - Rows queued with and without `skip_duplicates` for one table are written as separate | ||
| batches, so an ordinary overwrite is no longer skipped when a `skip_duplicates` batch | ||
| is queued beside it. A flush interrupted by a `KeyboardInterrupt` or another | ||
| `BaseException` removes the attempted batch and names its keys, as a failed flush | ||
| does; the batch is never written again, and rows not yet sent stay queued. Each | ||
| batch's write is checked against the table's schema guard. A table's queued rows | ||
| and their ids change together, in one step, so an interruption never leaves them | ||
| out of step. (ITL-1381) |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Withdraw downstream records when a discarded result uses a table-wide attempt.
Queue connector result A, an in-memory result B guarded by A, and a record C guarded by B. If A fails,
discard()removes B. Butfinish_rows()looks up B by ID, whileInMemoryArrowDatabase.pending_result()registered B's attempt underNone. C stays queued and blocked. Flushing B's now-empty table does not resolve that attempt. Delta uses the same table-wide registration.Track each result's dependents by ID, even when the backend writes results in one transaction. Resolve the affected IDs on removal so that C is withdrawn without withdrawing records that depend on surviving results.