Skip to content
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

workload/schemachange: add SET LOCALITY REGIONAL BY ROW [AS] #62909

Merged
merged 5 commits into from
May 4, 2021

Conversation

otan
Copy link
Contributor

@otan otan commented Mar 31, 2021

See individual commits for details.

@otan otan requested a review from ajwerner March 31, 2021 22:57
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan otan force-pushed the schemachange_rbr branch from a4afb62 to 1d9a1d2 Compare April 1, 2021 02:14
@otan
Copy link
Contributor Author

otan commented Apr 1, 2021

hmm, i don't understand the failure:


I210401 02:10:50.444333 597596 testutils/testcluster/testcluster.go:101  [-] 222348  TestCluster quiescing nodes
W210401 02:10:50.444414 599702 sql/sqlliveness/slinstance/slinstance.go:183  [n3] 222349  exiting heartbeat loop
W210401 02:10:50.444508 599703 jobs/registry.go:729  [-] 222350  canceling all adopted jobs due to stopper quiescing
W210401 02:10:50.444570 613534 kv/kvserver/closedts/sidetransport/receiver.go:125  [n3] 222351  closed timestamps side-transport connection dropped from node: 2
W210401 02:10:50.444612 616879 kv/kvserver/closedts/sidetransport/receiver.go:125  [n2] 222352  closed timestamps side-transport connection dropped from node: 3
W210401 02:10:50.444730 600006 kv/kvserver/closedts/sidetransport/receiver.go:125  [n3] 222354  closed timestamps side-transport connection dropped from node: 1
W210401 02:10:50.444690 616890 kv/kvserver/closedts/sidetransport/receiver.go:125  [n1] 222353  closed timestamps side-transport connection dropped from node: 3
W210401 02:10:50.444779 598111 sql/sqlliveness/slinstance/slinstance.go:183  [n1] 222355  exiting heartbeat loop
W210401 02:10:50.444843 598112 jobs/registry.go:729  [-] 222356  canceling all adopted jobs due to stopper quiescing
W210401 02:10:50.444836 613289 kv/kvserver/closedts/sidetransport/receiver.go:125  [n1] 222357  closed timestamps side-transport connection dropped from node: 2
W210401 02:10:50.444959 599286 jobs/registry.go:729  [-] 222358  canceling all adopted jobs due to stopper quiescing
W210401 02:10:50.445017 599979 kv/kvserver/closedts/sidetransport/receiver.go:125  [n2] 222359  closed timestamps side-transport connection dropped from node: 1
W210401 02:10:50.445109 614051 kv/kvserver/raft_transport.go:633  [n2] 222360  while processing outgoing Raft queue to node 3: EOF:
W210401 02:10:50.445149 600562 kv/kvserver/raft_transport.go:633  [n1] 222361  while processing outgoing Raft queue to node 2: EOF:
W210401 02:10:50.445204 599285 sql/sqlliveness/slinstance/slinstance.go:183  [n2] 222362  exiting heartbeat loop
FAIL
FAIL	github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange	260.801s
FAIL

nothing looks dead o_o schema changes seem like they're doing ok.

@otan
Copy link
Contributor Author

otan commented Apr 1, 2021

ah nvm it's higher up

--- FAIL: TestWorkload (5.55s)
    schema_change_external_test.go:111:
        	Error Trace:	schema_change_external_test.go:111
        	Error:      	Received unexpected error:
        	            	***UNEXPECTED ERROR; Received an unexpected execution error: ERROR: relation "table160" (89): unimplemented: cannot perform a schema change operation while a primary key change is in progress (SQLSTATE 0A000)
        	            	(1) forced error mark
        	            	  | "fatal error when running txn"
        	            	  | github.com/cockroachdb/errors/withstack/*withstack.withStack::
        	            	Wraps: (2) attached stack trace
        	            	  -- stack trace:
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).runInTxn
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:401
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).run
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:435
        	            	  | github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange_test.TestWorkload.func3.1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange/schema_change_external_test.go:100
        	            	  | golang.org/x/sync/errgroup.(*Group).Go.func1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	  | runtime.goexit
        	            	  | 	/usr/local/opt/[email protected]/libexec/src/runtime/asm_amd64.s:1374
        	            	Wraps: (3) ***UNEXPECTED ERROR; Received an unexpected execution error
        	            	Wraps: (4) ERROR: relation "table160" (89): unimplemented: cannot perform a schema change operation while a primary key change is in progress (SQLSTATE 0A000)
        	            	Error types: (1) *markers.withMark (2) *withstack.withStack (3) *errutil.withPrefix (4) pgx.PgError
        	Test:       	TestWorkload

@otan otan force-pushed the schemachange_rbr branch from 1d9a1d2 to 3852935 Compare April 1, 2021 03:12
Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I get an honest experience report? How is this going?

I think you need a rebase for the test failure.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan)


pkg/workload/schemachange/error_screening.go, line 808 at r2 (raw file):

		tx,
		`
		SELECT EXISTS (SELECT table_id FROM crdb_internal.schema_changes

I'm torn here. One the one hand, ideally we'll use the catalog tables and they will work great and yay. On the other hand, many (almost all) catalog tables lack virtual indexes which means that the more of these checks which use those tables we have, the more likely we are to scan the entire descriptor table and thus conflict with all other schema change transactions. On the other, other hand, we already do have a lot of checks which result in said scans.

I'm filing an issue (#62930) to create virtual indexes for every virtual table which we can index by table. That will help a lot. In the meantime, you could write this like:

SELECT json_array_length(
        crdb_internal.pb_to_json(
            'cockroach.sql.sqlbase.Descriptor',
            descriptor
        )->'table'->'mutations'
       )
       = 0
  FROM system.descriptor
 WHERE id = $1::REGCLASS;

Take it or leave it, I really am fine if you leave it.


pkg/workload/schemachange/operation_generator.go, line 462 at r2 (raw file):

	tx *pgx.Tx, tableName *tree.TableName,
) (bool, error) {
	if len(og.opsInTxn) > 0 {

🤔 why? The changes are likely for a different table.


pkg/workload/schemachange/schemachange.go, line 358 at r2 (raw file):

Quoted 8 lines of code…
		// Some ops can only be done executed if they are standalone (e.g.
		// anything using ALTER PRIMARY KEY). Early exit if so.
		if len(w.opGen.opsInTxn) > 0 {
			switch w.opGen.opsInTxn[len(w.opGen.opsInTxn)-1] {
			case alterTableLocality:
				break
			}
		}

isn't this just saying that it's the last operation, not that it's standalone. I also don't really understand the condition or why to special case this. Is it just that you'd like it to not fail most of the time and it is only likely to succeed if there's just one operation? I've been thinking that probably this uniform distribution of the number of commands isn't wise. Perhaps we should do something more exponential.

@otan otan force-pushed the schemachange_rbr branch from 3852935 to 2ff55dd Compare April 1, 2021 04:31
Copy link
Contributor Author

@otan otan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I get an honest experience report? How is this going?

it's.... ok. it's a little annoying having to think of all the error cases upfront, and some data is hard to access (e.g. existing schema change). the UDT stuff seems rare to hit as well. but rewarding for sure :)

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/workload/schemachange/operation_generator.go, line 462 at r2 (raw file):

Previously, ajwerner wrote…

🤔 why? The changes are likely for a different table.

hmm, it needs to be the only mutation on the table and might not be committed yet?
but the schema_change / scan you mention above takes care of this i think, so removing it!


pkg/workload/schemachange/schemachange.go, line 358 at r2 (raw file):

Previously, ajwerner wrote…
		// Some ops can only be done executed if they are standalone (e.g.
		// anything using ALTER PRIMARY KEY). Early exit if so.
		if len(w.opGen.opsInTxn) > 0 {
			switch w.opGen.opsInTxn[len(w.opGen.opsInTxn)-1] {
			case alterTableLocality:
				break
			}
		}

isn't this just saying that it's the last operation, not that it's standalone. I also don't really understand the condition or why to special case this. Is it just that you'd like it to not fail most of the time and it is only likely to succeed if there's just one operation? I've been thinking that probably this uniform distribution of the number of commands isn't wise. Perhaps we should do something more exponential.

hmm, i removed it. might be because earlier on i had a bad in progress schema_changes check.

@otan otan requested a review from ajwerner April 5, 2021 11:25
Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 3 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner and @otan)


pkg/workload/schemachange/operation_generator.go, line 462 at r2 (raw file):

Previously, otan (Oliver Tan) wrote…

hmm, it needs to be the only mutation on the table and might not be committed yet?
but the schema_change / scan you mention above takes care of this i think, so removing it!

seems like it is still present

@otan otan force-pushed the schemachange_rbr branch from 2ff55dd to dd7725f Compare April 6, 2021 12:19
Copy link
Contributor Author

@otan otan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/workload/schemachange/operation_generator.go, line 462 at r2 (raw file):

Previously, ajwerner wrote…

seems like it is still present

Deleting this gives me:

W210406 12:20:16.933591 175236 kv/kvserver/raft_transport.go:633  [n1] 65343  while processing outgoing Raft queue to node 2: rpc error: code = Canceled desc = grpc: the client connection is closing:
--- FAIL: TestWorkload (9.18s)
    schema_change_external_test.go:111:
        	Error Trace:	schema_change_external_test.go:111
        	Error:      	Received unexpected error:
        	            	***UNEXPECTED ERROR; Received an unexpected execution error: ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	(1) forced error mark
        	            	  | "fatal error when running txn"
        	            	  | github.com/cockroachdb/errors/withstack/*withstack.withStack::
        	            	Wraps: (2) attached stack trace
        	            	  -- stack trace:
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).runInTxn
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:392
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).run
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:426
        	            	  | github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange_test.TestWorkload.func3.1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange/schema_change_external_test.go:100
        	            	  | golang.org/x/sync/errgroup.(*Group).Go.func1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	  | runtime.goexit
        	            	  | 	/usr/local/opt/[email protected]/libexec/src/runtime/asm_amd64.s:1374
        	            	Wraps: (3) ***UNEXPECTED ERROR; Received an unexpected execution error
        	            	Wraps: (4) ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	Error types: (1) *markers.withMark (2) *withstack.withStack (3) *errutil.withPrefix (4) pgx.PgError
        	Test:       	TestWorkload

@otan
Copy link
Contributor Author

otan commented Apr 6, 2021


pkg/workload/schemachange/operation_generator.go, line 462 at r2 (raw file):

Previously, otan (Oliver Tan) wrote…

Deleting this gives me:

W210406 12:20:16.933591 175236 kv/kvserver/raft_transport.go:633  [n1] 65343  while processing outgoing Raft queue to node 2: rpc error: code = Canceled desc = grpc: the client connection is closing:
--- FAIL: TestWorkload (9.18s)
    schema_change_external_test.go:111:
        	Error Trace:	schema_change_external_test.go:111
        	Error:      	Received unexpected error:
        	            	***UNEXPECTED ERROR; Received an unexpected execution error: ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	(1) forced error mark
        	            	  | "fatal error when running txn"
        	            	  | github.com/cockroachdb/errors/withstack/*withstack.withStack::
        	            	Wraps: (2) attached stack trace
        	            	  -- stack trace:
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).runInTxn
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:392
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).run
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:426
        	            	  | github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange_test.TestWorkload.func3.1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange/schema_change_external_test.go:100
        	            	  | golang.org/x/sync/errgroup.(*Group).Go.func1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	  | runtime.goexit
        	            	  | 	/usr/local/opt/[email protected]/libexec/src/runtime/asm_amd64.s:1374
        	            	Wraps: (3) ***UNEXPECTED ERROR; Received an unexpected execution error
        	            	Wraps: (4) ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	Error types: (1) *markers.withMark (2) *withstack.withStack (3) *errutil.withPrefix (4) pgx.PgError
        	Test:       	TestWorkload
{
 "workerId": 0,
 "clientTimestamp": "12:21:46.345019",
 "ops": [
  "BEGIN",
  "ALTER TABLE schema271.table279 ADD COLUMN col279_286 INT4",
  "SELECT 'validating all objects'",
  "ALTER TABLE schema271.table279 SET LOCALITY REGIONAL BY ROW"
 ],
 "expectedExecErrors": "",
 "expectedCommitErrors": "",
 "message": "***UNEXPECTED ERROR; Received an unexpected execution error: ERROR: unimplemented: cannot perform a locality change on table279 with other schema changes on table279 in the same transaction (SQLSTATE 0A000)",
 "txStatus": "TxStatusRollbackSuccess"
}

or this :\

@otan
Copy link
Contributor Author

otan commented Apr 6, 2021


pkg/workload/schemachange/schemachange.go, line 358 at r2 (raw file):

is currently undergoing a schema change

on re-running the test, it seems like removing this gives:

W210406 12:20:16.933591 175236 kv/kvserver/raft_transport.go:633  [n1] 65343  while processing outgoing Raft queue to node 2: rpc error: code = Canceled desc = grpc: the client connection is closing:
--- FAIL: TestWorkload (9.18s)
    schema_change_external_test.go:111:
        	Error Trace:	schema_change_external_test.go:111
        	Error:      	Received unexpected error:
        	            	***UNEXPECTED ERROR; Received an unexpected execution error: ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	(1) forced error mark
        	            	  | "fatal error when running txn"
        	            	  | github.com/cockroachdb/errors/withstack/*withstack.withStack::
        	            	Wraps: (2) attached stack trace
        	            	  -- stack trace:
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).runInTxn
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:392
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).run
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:426
        	            	  | github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange_test.TestWorkload.func3.1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange/schema_change_external_test.go:100
        	            	  | golang.org/x/sync/errgroup.(*Group).Go.func1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	  | runtime.goexit
        	            	  | 	/usr/local/opt/[email protected]/libexec/src/runtime/asm_amd64.s:1374
        	            	Wraps: (3) ***UNEXPECTED ERROR; Received an unexpected execution error
        	            	Wraps: (4) ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	Error types: (1) *markers.withMark (2) *withstack.withStack (3) *errutil.withPrefix (4) pgx.PgError
        	Test:       	TestWorkload

@otan
Copy link
Contributor Author

otan commented Apr 6, 2021


pkg/workload/schemachange/schemachange.go, line 358 at r2 (raw file):

Previously, otan (Oliver Tan) wrote…

is currently undergoing a schema change

on re-running the test, it seems like removing this gives:

W210406 12:20:16.933591 175236 kv/kvserver/raft_transport.go:633  [n1] 65343  while processing outgoing Raft queue to node 2: rpc error: code = Canceled desc = grpc: the client connection is closing:
--- FAIL: TestWorkload (9.18s)
    schema_change_external_test.go:111:
        	Error Trace:	schema_change_external_test.go:111
        	Error:      	Received unexpected error:
        	            	***UNEXPECTED ERROR; Received an unexpected execution error: ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	(1) forced error mark
        	            	  | "fatal error when running txn"
        	            	  | github.com/cockroachdb/errors/withstack/*withstack.withStack::
        	            	Wraps: (2) attached stack trace
        	            	  -- stack trace:
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).runInTxn
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:392
        	            	  | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).run
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/workload/schemachange/schemachange.go:426
        	            	  | github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange_test.TestWorkload.func3.1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/pkg/ccl/testccl/workload/schemachange/schema_change_external_test.go:100
        	            	  | golang.org/x/sync/errgroup.(*Group).Go.func1
        	            	  | 	/Users/otan/go/src/github.com/cockroachdb/cockroach/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	  | runtime.goexit
        	            	  | 	/usr/local/opt/[email protected]/libexec/src/runtime/asm_amd64.s:1374
        	            	Wraps: (3) ***UNEXPECTED ERROR; Received an unexpected execution error
        	            	Wraps: (4) ERROR: unimplemented: table table342 is currently undergoing a schema change (SQLSTATE 0A000)
        	            	Error types: (1) *markers.withMark (2) *withstack.withStack (3) *errutil.withPrefix (4) pgx.PgError
        	Test:       	TestWorkload

(might be wrong on this one, but hitting the hay now)

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/workload/schemachange/operation_generator.go, line 462 at r2 (raw file):

Previously, otan (Oliver Tan) wrote…
{
 "workerId": 0,
 "clientTimestamp": "12:21:46.345019",
 "ops": [
  "BEGIN",
  "ALTER TABLE schema271.table279 ADD COLUMN col279_286 INT4",
  "SELECT 'validating all objects'",
  "ALTER TABLE schema271.table279 SET LOCALITY REGIONAL BY ROW"
 ],
 "expectedExecErrors": "",
 "expectedCommitErrors": "",
 "message": "***UNEXPECTED ERROR; Received an unexpected execution error: ERROR: unimplemented: cannot perform a locality change on table279 with other schema changes on table279 in the same transaction (SQLSTATE 0A000)",
 "txStatus": "TxStatusRollbackSuccess"
}

or this :\

if mut.MutationID < currentMutationID {
// We can handle indexes being deleted concurrently. We do this
// in order to not be blocked on index drops created by a previous
// primary key change. If we errored out when seeing a previous
// index drop, then users would see a confusing message that a
// schema change is in progress when it doesn't seem like one is.
// TODO (rohany): This feels like such a hack until (#45510) is fixed.
if mut.GetIndex() != nil && mut.Direction == descpb.DescriptorMutation_DROP {
continue
}
return unimplemented.NewWithIssuef(
45510, "table %s is currently undergoing a schema change", tableDesc.Name)
}
grr this is a pretty opaque policy to put into the check.

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accept if you add some commentary around that odd rule. :lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)

@otan otan force-pushed the schemachange_rbr branch from dd7725f to 7748848 Compare April 6, 2021 12:50
@otan
Copy link
Contributor Author

otan commented Apr 6, 2021


pkg/workload/schemachange/operation_generator.go, line 462 at r2 (raw file):

Previously, ajwerner wrote…

if mut.MutationID < currentMutationID {
// We can handle indexes being deleted concurrently. We do this
// in order to not be blocked on index drops created by a previous
// primary key change. If we errored out when seeing a previous
// index drop, then users would see a confusing message that a
// schema change is in progress when it doesn't seem like one is.
// TODO (rohany): This feels like such a hack until (#45510) is fixed.
if mut.GetIndex() != nil && mut.Direction == descpb.DescriptorMutation_DROP {
continue
}
return unimplemented.NewWithIssuef(
45510, "table %s is currently undergoing a schema change", tableDesc.Name)
}
grr this is a pretty opaque policy to put into the check.

realised the latter one was a typo -- should be > 0 not = 0 for the length check.

@otan otan force-pushed the schemachange_rbr branch from 7748848 to 97f97ee Compare April 21, 2021 05:11
@otan otan requested a review from a team April 21, 2021 05:11
@otan
Copy link
Contributor Author

otan commented Apr 21, 2021

i've had successful runs barring other issues in the schemachange workload (SET DATA TYPE runs into other issues?) so i'm merging this one!

bors r=ajwerner

craig bot pushed a commit that referenced this pull request Apr 21, 2021
62909: workload/schemachange: add SET LOCALITY REGIONAL BY ROW [AS] r=ajwerner a=otan

See individual commits for details.

Co-authored-by: Oliver Tan <[email protected]>
@otan
Copy link
Contributor Author

otan commented Apr 21, 2021

bors r-

ooh, one more thing

@craig
Copy link
Contributor

craig bot commented Apr 21, 2021

Canceled.

@ajstorm
Copy link
Collaborator

ajstorm commented Apr 29, 2021

Just noticed that the case here has gone cold. Was that intentional? Should this PR be closed?

@otan
Copy link
Contributor Author

otan commented Apr 29, 2021

Still needs to be done? With our blocks on concurrent changes it'll take a bit more massaging...

@otan otan force-pushed the schemachange_rbr branch from 97f97ee to eaee350 Compare May 3, 2021 00:20
@otan otan requested a review from a team May 3, 2021 00:20
@otan otan marked this pull request as draft May 3, 2021 00:21
otan added 4 commits May 4, 2021 09:03
This previously did not take into account implicit primary keys.

Release note: None
Certain operations cannot be performed during ALTER PK.

Release note: None
REGIONAL BY ROW tables do not allow index changes during an ADD/DROP
REGION.

Release note: None
@otan otan marked this pull request as ready for review May 4, 2021 03:11
@otan otan force-pushed the schemachange_rbr branch from eaee350 to 703c812 Compare May 4, 2021 03:23
@otan otan force-pushed the schemachange_rbr branch from 703c812 to a9c0687 Compare May 4, 2021 21:38
@otan
Copy link
Contributor Author

otan commented May 4, 2021

works after reverting #63725 so merging this one
feel free to set ADD/DROP REGION to 0 if it breaks when we unflake schemachange

bors r=ajwerner

@craig
Copy link
Contributor

craig bot commented May 4, 2021

Build succeeded:

@craig craig bot merged commit 853a6bc into cockroachdb:master May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants