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: add additional logs to the compaction picker #2837

Closed
wants to merge 2 commits into from
Closed

db: add additional logs to the compaction picker #2837

wants to merge 2 commits into from

Conversation

bananabrick
Copy link
Contributor

No description provided.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@bananabrick bananabrick requested review from a team and sumeerbhola August 17, 2023 21:43
@bananabrick bananabrick changed the title db: add additional logic to the compaction picker db: add additional logs to the compaction picker Aug 17, 2023
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 1 files reviewed, 2 unresolved discussions (waiting on @sumeerbhola)


compaction_picker.go line 1104 at r1 (raw file):

		info.score = fileScore
	}
	info.origScore = info.score

Just used for logging, but we never set it for L0. Makes the logs confusing.


compaction_picker.go line 1280 at r1 (raw file):

					p.vers.Levels[info.level].Iter(),
				))),
				humanize.Bytes.Int64(int64(totalSize(

Useful to see the actual size of the level in the logs.

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @bananabrick)


compaction_picker.go line 1280 at r1 (raw file):

Previously, bananabrick (Arjun Nair) wrote…

Useful to see the actual size of the level in the logs.

We should not be using totalCompensatedSize and totalSize here since they are linear in the number of files in the level. We should do what calculateScores does:

int64(levelCompensatedSize(p.vers.Levels[level]))

p.levelSizes[level]

and probably do the sizeAdjust logic too. We could make calculateScores return the sizeAdjust and use it here.

@bananabrick bananabrick closed this by deleting the head repository Nov 10, 2023
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