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

db: save level iter debug output before closing #1460

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

nicktrav
Copy link
Contributor

Currently, if the level checker encounters a violation an the iterator
for the last level has been closed, the debug string providing
information on the level and the file is lost.

Save the debug string for potential use after the iterator is closed.

// Before
checker failed with error: found InternalKey zzqwavxgrec@12#4092,SINGLEDEL in L0.2: fileNum=000830 and InternalKey zzqwavxgrec@12#4627,DEL in %!s(<nil>)

// After
checker failed with error: found InternalKey zzqwavxgrec@12#4092,SINGLEDEL in L0.2: fileNum=000830 and InternalKey zzqwavxgrec@12#4627,DEL in L6: fileNum=000997

Related to #1459.

Currently, if the level checker encounters a violation an the iterator
for the last level has been closed, the debug string providing
information on the level and the file is lost.

Save the debug string for potential use after the iterator is closed.

```
// Before
checker failed with error: found InternalKey zzqwavxgrec@12#4092,SINGLEDEL in L0.2: fileNum=000830 and InternalKey zzqwavxgrec@12#4627,DEL in %!s(<nil>)

// After
checker failed with error: found InternalKey zzqwavxgrec@12#4092,SINGLEDEL in L0.2: fileNum=000830 and InternalKey zzqwavxgrec@12#4627,DEL in L6: fileNum=000997
```

Related to cockroachdb#1459.
@nicktrav nicktrav requested a review from jbowens January 20, 2022 18:18
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

:lgtm:

Nice, had a similar commit staged locally :)

Reviewable status: 0 of 1 files reviewed, all discussions resolved

@nicktrav nicktrav merged commit f3d164d into cockroachdb:master Jan 20, 2022
@nicktrav nicktrav deleted the nickt.level-check-debug branch January 20, 2022 20:13
@nicktrav
Copy link
Contributor Author

Nice, had a similar commit staged locally :)

Great minds ... something something.

TFTR!

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