Skip to content

Conversation

@darshanime
Copy link
Contributor

Add periodic calls to (objstorage.Provider).Sync

Closes: #3025

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jbowens jbowens requested review from a team and RaduBerinde December 5, 2023 15:46
Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Reviewable status: 0 of 3 files reviewed, 4 unresolved discussions (waiting on @darshanime)


cleaner.go line 176 at r1 (raw file):

func (cm *cleanupManager) deleteObsoleteObjectAndSyncIfRequired(jobID int, fileNum base.DiskFileNum, fileSize uint64) {
	var deleteThresholdForSync uint64 = 64 * 1024 * 1024 // 64 MB

[nit] this should be a constant around the top of the file (next to jobsQueueDepth)


cleaner.go line 188 at r1 (raw file):

	}

	if err := cm.objProvider.Sync(); err == nil {

We should log the error here. I think we should still reset deletedFileSizePendingSync even in the error case, it's unlikely that retrying after every object will help.


cleaner.go line 265 at r1 (raw file):

}

func (cm *cleanupManager) deleteObsoleteObject(

This needs an explanation of the return value. Though I don't think it's worth it, the case of the object not existing is unlikely to happen in practice


testdata/cleaner line 190 at r1 (raw file):

close: db1/000123.sst

create-bogus-file db1/000456.sst 100000000

Add a comment explaining that we're setting a large file size to verify that the cleaner issues a sync.

@darshanime
Copy link
Contributor Author

@RaduBerinde thanks for the review! I have addressed the comments (pardon the delay!)

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.

db: periodically sync the data directory during file deletions

3 participants