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

sstable: Make sstable Writer.Close idempotent #1485

Merged
merged 1 commit into from
Jan 31, 2022
Merged

sstable: Make sstable Writer.Close idempotent #1485

merged 1 commit into from
Jan 31, 2022

Conversation

bananabrick
Copy link
Contributor

@bananabrick bananabrick commented Jan 31, 2022

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor Author

@bananabrick bananabrick 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: 0 of 2 files reviewed, 1 unresolved discussion


sstable/write_queue.go, line 109 at r1 (raw file):

// finish will return any error which was encountered while tasks were processed.
func (w *writeQueue) finish() error {
	if w.closed {

I make an assumption here that finish won't be called concurrently by two goroutines, which means that Close won't be called concurrently by two goroutines, which seems like a decent assumption.

@bananabrick bananabrick requested a review from a team January 31, 2022 18:40
Copy link
Contributor

@itsbilal itsbilal 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 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @bananabrick)


sstable/write_queue.go, line 109 at r1 (raw file):

Previously, bananabrick (Arjun Nair) wrote…

I make an assumption here that finish won't be called concurrently by two goroutines, which means that Close won't be called concurrently by two goroutines, which seems like a decent assumption.

It's a fair assumption as the writer isn't really safe for concurrent use in general so it should be fine.

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.

kv/kvserver: TestSplitTriggerMeetsUnexpectedReplicaID failed
3 participants