sql: move schema change backfill logic to sql/backfill#25362
sql: move schema change backfill logic to sql/backfill#25362craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
15cec60 to
5145f74
Compare
|
Review status: 0 of 5 files reviewed at latest revision, all discussions resolved. pkg/sql/sqlbase/backfill.go, line 24 at r1 (raw file):
Depending on SQL/scrub from sqlbase seems funky to me. You sure sqlbase is the right package for this? Wouldn't a new package be better? Comments from Reviewable |
|
it's really a refactor to allow use of distsql processor code on a local execution path. One option is to create sql/processors and put it there? |
c2000ba to
d8488b3
Compare
|
Review status: 0 of 5 files reviewed at latest revision, 1 unresolved discussion. pkg/sql/sqlbase/backfill.go, line 377 at r2 (raw file):
To address andrei's comment: I think we can just outright remove this check, and thus the package import. It was included in all calls of the above function (fetcher.NextRow) but we know that we are never doing anything scrub related in the backfiller, and thus can never produce that error. Comments from Reviewable |
|
I've moved the common backfill code to sql/backfill and have gotten rid of the scrub dependency. |
The distsql backfill calls the sql/backfill code. The future plan is to also call backfill within a transaction that runs schema changes in the same transaction as a CREATE TABLE. Since the CREATE TABLE in a transaction is not visible to other transactions until the transaction commits, the schema change can run the backfill without incrementing the version of the table descriptor and running the schema change state machine. related to cockroachdb#24626 Release note: None
|
bors r+ |
25362: sql: move schema change backfill logic to sql/backfill r=vivekmenezes a=vivekmenezes The distsql backfill calls the sql/backfill code. The future plan is to also call backfill within a transaction that runs schema changes in the same transaction as a CREATE TABLE. Since the CREATE TABLE in a transaction is not visible to other transactions until the transaction commits, the schema change can run the backfill without incrementing the version of the table descriptor. related to #24626 Release note: None 25476: acceptance: remove Finagle test r=a-robinson a=tschottdorf It does do away with the issue #8332, though I'm avoiding the Github keyword to close it to test whether bors will still auto-close the issue due to the mention in the actual commit. Release note: None Co-authored-by: Vivek Menezes <vivek@cockroachlabs.com> Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
Build succeeded |
24883: dep: Bump grpc-go version r=a-robinson a=a-robinson And pull in new packages -- in particular, the encoding/proto package isn't needed for compilation but is needed at runtime. Release note: None --------------------- We should wait to merge this until they've cut the 1.12 release tag so that we aren't just at an arbitrary commit in their git history but I'm sending out the PR now so that I (or whoever would have done this) don't have to deal with debugging the missing encoding/proto package when it comes time to merge this. As tested in #17370 (comment), this gives a 5-10% boost in whole-cluster throughput and improved tail latencies when run with a highly concurrent workload. It appears to have little performance effect for lower-concurrency workloads. 25410: sql: run schema changes after CREATE TABLE in txn r=vivekmenezes a=vivekmenezes Includes a commit from #25362 and should be reviewed after that change. 25612: util: fix `retry.WithMaxAttempts` context cancelled before run. r=windchan7 a=windchan7 If context gets cancelled right after `retry.WithMaxAttempts` runs, the function passed to it will never gets run. Now `retry.WithMaxAttempts` will at least run the function once otherwise an error will be returned. Making this change because there are places such as `show_cluster_setting.go` require the passed in function to be run at least once. Otherwise there will be seg fault. Fixes: #25600. Fixes: #25603. Fixes: #25570. Fixes: #25567. Fixes: #25566. Fixes: #25511. Fixes: #25485. Release note: None 25625: storage: Adding testing knob to disable automatic lease renewals r=a-robinson a=a-robinson In order to fix the test flakes caused by automatic lease renewals Fixes #25537 Fixes #25540 Fixes #25568 Fixes #25573 Fixes #25576 Fixes #25589 Fixes #25594 Fixes #25599 Fixes #25605 Fixes #25620 Release note: None Co-authored-by: Alex Robinson <alexdwanerobinson@gmail.com> Co-authored-by: Vivek Menezes <vivek@cockroachlabs.com> Co-authored-by: Victor Chen <victor@cockroachlabs.com>
The distsql backfill calls the sql/backfill code.
The future plan is to also call backfill within a transaction
that runs schema changes in the same transaction as a
CREATE TABLE. Since the CREATE TABLE in a transaction
is not visible to other transactions until the transaction
commits, the schema change can run the backfill without
incrementing the version of the table descriptor.
related to #24626
Release note: None