Skip to content

server: add TestBumpClusterVersion#57637

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
irfansharif:201207.test-bump-cv
Dec 9, 2020
Merged

server: add TestBumpClusterVersion#57637
craig[bot] merged 1 commit intocockroachdb:masterfrom
irfansharif:201207.test-bump-cv

Conversation

@irfansharif
Copy link
Copy Markdown
Contributor

Tests the machinery that's being used to bump cluster versions during version
upgrades. Pulled out of our prototype in #57445.

Release note: None

@irfansharif irfansharif requested a review from a team as a code owner December 7, 2020 14:49
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@tbg tbg 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 @irfansharif, @knz, @tbg, and @TheSamHuang)


pkg/server/migration_test.go, line 101 at r1 (raw file):

}

func TestBumpClusterVersion(t *testing.T) {

// TestBumpClusterVersion verifies that the BumpClusterVersion RPC correctly
// persists the cluster version to disk and updates the active in-memory version.


pkg/server/migration_test.go, line 138 at r1 (raw file):

	ctx := context.Background()
	for _, test := range tests {

use subtests here, then you can also defer the stopper.Stop() call. Right now we're leaking goroutines if the test fails.


pkg/server/migration_test.go, line 170 at r1 (raw file):

			ClusterVersion: &test.bumpClusterVersion,
		}
		if _, err := migrationServer.BumpClusterVersion(ctx, req); err != nil {

Would you mind updating WriteClusterVersion (not in the diff) to take a raw engine, and add a comment that this ensures that the write is synched. Right now it takes a ReadWriter and is thus subject to not syncing automatically when called with, e.g., a batch.
Or, we make them take an explicit batch, deal with all the fallout, and then make sure to Commit(true /* sync */) that batch.

Doesn't have to be in this PR, probably should not.


pkg/server/migration_test.go, line 174 at r1 (raw file):

		}

		// Check to see our post-bump active cluster version is what we expect.

see if our

@tbg tbg self-requested a review December 9, 2020 14:29
Tests the machinery that's being used to bump cluster versions during version
upgrades. Pulled out of our prototype in cockroachdb#57445.

Release note: None
@irfansharif
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 9, 2020

Build failed:

@irfansharif
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 9, 2020

Build succeeded:

@craig craig bot merged commit 4145587 into cockroachdb:master Dec 9, 2020
@irfansharif irfansharif deleted the 201207.test-bump-cv branch December 9, 2020 22:31
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