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

workloadccl: inject table statistics during fixtures load #39106

Merged

Conversation

nvanbenschoten
Copy link
Member

See #39103.

Release note: None

@nvanbenschoten nvanbenschoten requested review from danhhz and a team July 25, 2019 20:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@danhhz danhhz left a comment

Choose a reason for hiding this comment

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

:lgtm:

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


pkg/ccl/workloadccl/fixture.go, line 546 at r1 (raw file):

	if injectStats && tablesHaveStats(tables) {
		// Turn off automatic stats temporarily so we don't trigger stats creation
		// after the IMPORT. We will inject stats inside importFixtureTable.

nit: RESTORE


pkg/ccl/workloadccl/fixture.go, line 550 at r1 (raw file):

		// just trigger a no-op if there are new stats available so we wouldn't
		// have to disable and re-enable automatic stats here.
		enableFn := disableAutoStats(ctx, sqlDB)

this disableAutoStats and the defer need to go before the RESTORE jobs get kicked off, otherwise you have a race here where the auto stats could start up after the restore finishes but before this line

Copy link
Member

@RaduBerinde RaduBerinde 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! 1 of 0 LGTMs obtained (waiting on @danhhz and @nvanbenschoten)


pkg/ccl/workloadccl/fixture.go, line 545 at r1 (raw file):

	tables := fixture.Generator.Tables()
	if injectStats && tablesHaveStats(tables) {
		// Turn off automatic stats temporarily so we don't trigger stats creation

I don't think this comment is accurate here.

In the existing code, we disabled auto stats before the import and ran the enableFn after the injection. I think we should do the same here (by the time this code runs, we may have started an auto stats job).

@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/injectOnBackup branch from 05ca887 to 0045120 Compare July 25, 2019 20:36
Copy link
Member Author

@nvanbenschoten nvanbenschoten 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! 1 of 0 LGTMs obtained


pkg/ccl/workloadccl/fixture.go, line 545 at r1 (raw file):

Previously, RaduBerinde wrote…

I don't think this comment is accurate here.

In the existing code, we disabled auto stats before the import and ran the enableFn after the injection. I think we should do the same here (by the time this code runs, we may have started an auto stats job).

Done.


pkg/ccl/workloadccl/fixture.go, line 546 at r1 (raw file):

Previously, danhhz (Daniel Harrison) wrote…

nit: RESTORE

Done.


pkg/ccl/workloadccl/fixture.go, line 550 at r1 (raw file):

Previously, danhhz (Daniel Harrison) wrote…

this disableAutoStats and the defer need to go before the RESTORE jobs get kicked off, otherwise you have a race here where the auto stats could start up after the restore finishes but before this line

Done.

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)

@nvanbenschoten
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Jul 25, 2019
39106: workloadccl: inject table statistics during fixtures load r=nvanbenschoten a=nvanbenschoten

See #39103.

Release note: None

Co-authored-by: Nathan VanBenschoten <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jul 25, 2019

Build succeeded

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