-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stage: Track applied mutations in staging tables
This change moves tracking of partially-applied resolved timestamp windows into the staging tables by adding a new `applied` column. The goal of this change is to move some state-tracking out of the cdc resolver loop into the stage package. Tracking apply status on a per-mutation basis improves idempotency of cdc-sink when the userscript has non-idempotent behaviors (e.g.: three-way merge). It also allows us to export monitoring data around mutations which may have slipped through the cracks or to detect when a migration process has completely drained. Fine-grained tracking will also be useful for unifying the non-transactional modes into a single behavior. Many unused methods in the stage API have been deleted. The "unstaging" SQL query is now generated with a golang template and is tested similarly to the apply package. The cdc package performs less work to track partial application of large individual changes. It just persists the contents of the UnstageCursor as a performance enhancement. Exactly-once behavior is provided by the applied column. The change to `server/integration_test.go` is due to the unstage processing being a one-shot. The test being performed duplicates an existing test in `cdc/handler_test.go`. Breaking change: The `--selectBatchSize` flag is deprecated in favor of two different flags `--largeTransactionLimit` and `--timestampWindowSize` which, respectively, enable partial processing of a single, over-sized transaction and a general limit on the total amount of data to be unstaged. Breaking change: A staging schema migraion is required, this is documented in the migrations directory. X-Ref: #487 X-Ref: #504 X-Ref: #565
- Loading branch information
Showing
18 changed files
with
1,067 additions
and
925 deletions.
There are no files selected for viewing
This file contains 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 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 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.