Skip to content

storage: adjust raft log size correctly when replacing sideloaded entries#31926

Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom
tbg:fix/raft-log-size-overwrite-sideloaded
Oct 26, 2018
Merged

storage: adjust raft log size correctly when replacing sideloaded entries#31926
craig[bot] merged 3 commits intocockroachdb:masterfrom
tbg:fix/raft-log-size-overwrite-sideloaded

Conversation

@tbg
Copy link
Copy Markdown
Member

@tbg tbg commented Oct 26, 2018

This follows up on a comment of @nvanbenschoten in #31914 which highlighted yet
another potential (though hopefully rare) source of raft log size not being
reduced correctly.

Release note: None

tbg added 2 commits October 26, 2018 17:41
…ries

This follows up on a comment of @nvanbenschoten in cockroachdb#31914.
Unfortunately, it seems really hairy to come up with a test for this,
so a bit of refactoring will be needed.

Release note: None
In preparation for writing a unit test. No functionality changes
intended in this commit.

Release note: None
@tbg tbg requested a review from a team October 26, 2018 16:23
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@tbg tbg requested a review from nvb October 26, 2018 16:23
Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r1, 2 of 2 files at r2, 1 of 1 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)


pkg/storage/replica_sideload_disk.go, line 118 at r1 (raw file):

func (ss *diskSideloadStorage) purgeFile(ctx context.Context, filename string) (int64, error) {
	// TODO(tschottdorf): this should all be done through the env. As written,
	// the sizes returned here will be wrong if encryption is one. We want the

s/one/on/


pkg/storage/replica_sideload_test.go, line 366 at r3 (raw file):

	assertCreated(false)

	// Repopulate with a few entries at indexes=1,2,4,5 and term 10 to test `maybePurgeSideloaded`

Not index 5.

@tbg tbg force-pushed the fix/raft-log-size-overwrite-sideloaded branch from b393ce0 to 12756fa Compare October 26, 2018 17:33
Copy link
Copy Markdown
Member Author

@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.

TFTR!

bors r=nvanbenschoten

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


pkg/storage/replica_sideload_disk.go, line 118 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

s/one/on/

Done.


pkg/storage/replica_sideload_test.go, line 366 at r3 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Not index 5.

Done.

craig bot pushed a commit that referenced this pull request Oct 26, 2018
31881: exec: distinct manages its own scratch column r=jordanlewis a=jordanlewis

Previously, distinct relied on its input batch to have a scratch boolean
column for working. It's unnecessary - instead, manage the scratch
boolean directly during construction.

Release note: None

31926: storage: adjust raft log size correctly when replacing sideloaded entries r=nvanbenschoten a=tschottdorf

This follows up on a comment of @nvanbenschoten in #31914 which highlighted yet
another potential (though hopefully rare) source of raft log size not being
reduced correctly.

Release note: None

Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com>
Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 26, 2018

Build succeeded

@craig craig bot merged commit 12756fa into cockroachdb:master Oct 26, 2018
@tbg tbg deleted the fix/raft-log-size-overwrite-sideloaded branch November 23, 2018 11:49
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