Skip to content

multiregionccl: add zone config waiting for partitioned tables#68444

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
pawalt:rbr_tracing
Aug 10, 2021
Merged

multiregionccl: add zone config waiting for partitioned tables#68444
craig[bot] merged 1 commit intocockroachdb:masterfrom
pawalt:rbr_tracing

Conversation

@pawalt
Copy link
Copy Markdown
Contributor

@pawalt pawalt commented Aug 4, 2021

Previously, wait-for-zone-configs could only wait on tables, meaning we
couldn't wait for zone config changes to apply to REGIONAL BY ROW
partitions. This PR adds a partition-name flag to allow users to wait
on a specific partition.

Release note: None

A future PR will extend the tracing to allow us to trace REGIONAL BY ROW queries, but those changes combined with these will likely be too large for a single PR.

@pawalt pawalt requested a review from arulajmani August 4, 2021 20:03
@pawalt pawalt requested review from a team as code owners August 4, 2021 20:03
@pawalt pawalt requested review from erikgrinaker and removed request for a team August 4, 2021 20:03
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@pawalt pawalt removed the request for review from erikgrinaker August 4, 2021 20:03
Copy link
Copy Markdown
Collaborator

@arulajmani arulajmani 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 @pawalt)


pkg/ccl/multiregionccl/datadriven_test.go, line 681 at r1 (raw file):

	var lookupKey roachpb.Key
	if !d.HasArg(partitionName) {

nit: return early if there's no partitionName arg so you can get rid of the else case here.


pkg/testutils/serverutils/test_cluster_shim.go, line 197 at r1 (raw file):

	// LookupTable returns the table descriptor for the specified database and
	// table names.
	LookupTable(database, table string) (catalog.TableDescriptor, error)

I don't think this should be an interface method on TestClusterInterface, mostly because Tables are a catalog concept and all the other interface methods here seem to be a function of the cluster/server.

Looks like the only thing that LookupTable needs from the test cluster is an executor config. I'd recommend passing that into the function instead of making it a method on TestCluster below.

As for where this should live, maybe we need a testutils file in the descs package which exposes a LookupHydratedTableDescriptor. I'm not sure, maybe @ajwerner might have a suggestion.

Alternatively, considering there's only one use of this method right now, you could move it into the file that you're calling it from for now as well.

Copy link
Copy Markdown
Contributor Author

@pawalt pawalt 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/testutils/serverutils/test_cluster_shim.go, line 197 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

I don't think this should be an interface method on TestClusterInterface, mostly because Tables are a catalog concept and all the other interface methods here seem to be a function of the cluster/server.

Looks like the only thing that LookupTable needs from the test cluster is an executor config. I'd recommend passing that into the function instead of making it a method on TestCluster below.

As for where this should live, maybe we need a testutils file in the descs package which exposes a LookupHydratedTableDescriptor. I'm not sure, maybe @ajwerner might have a suggestion.

Alternatively, considering there's only one use of this method right now, you could move it into the file that you're calling it from for now as well.

I've moved this to a helper function within the test file

@pawalt pawalt force-pushed the rbr_tracing branch 2 times, most recently from d10db7b to 7628c95 Compare August 9, 2021 22:07
Copy link
Copy Markdown
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

:lgtm: once the comment is addressed.

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


pkg/ccl/multiregionccl/datadriven_test.go, line 290 at r3 (raw file):

				// wrapped in a succeeds soon.
				if err := testutils.SucceedsSoonError(func() error {
					lookupKey, err := getRangeKeyForInput(t, d, ds.tc)

Any reason this is inside the succeeds soon? Can we pull it out so we fail quickly in case some arguments aren't provided?

Previously, wait-for-zone-configs could only wait on tables, meaning we
couldn't wait for zone config changes to apply to REGIONAL BY ROW
partitions. This PR adds a `partition-name` flag to allow users to wait
on a specific partition.

Release note: None
Copy link
Copy Markdown
Contributor Author

@pawalt pawalt 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 (and 1 stale) (waiting on @ajwerner and @arulajmani)


pkg/ccl/multiregionccl/datadriven_test.go, line 290 at r3 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

Any reason this is inside the succeeds soon? Can we pull it out so we fail quickly in case some arguments aren't provided?

Good point; no reason why this should fail. I'll move it out.

@pawalt
Copy link
Copy Markdown
Contributor Author

pawalt commented Aug 10, 2021

bors r=arulajmani

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 10, 2021

Build succeeded:

@craig craig bot merged commit f28f98f into cockroachdb:master Aug 10, 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.

3 participants