rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

Fix recycled WAL detection when wal_compression is enabled

Open ajkr opened this issue 1 year ago • 4 comments

I think the point of the if (end_of_buffer_offset_ - buffer_.size() == 0) was to only set recycled_ when the first record was read. However, the condition was false when reading the first record when the WAL began with a kSetCompressionType record because we had already dropped the kSetCompressionType record from buffer_. To fix this, I used first_record_read_ instead.

Also, it was pretty confusing to treat the WAL as non-recycled when a recyclable record first appeared in a non-first record. I changed it to return an error if that happens.

ajkr avatar May 11 '24 00:05 ajkr

@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar May 11 '24 00:05 facebook-github-bot

@ajkr has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar May 15 '24 19:05 facebook-github-bot

@ajkr has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar May 15 '24 19:05 facebook-github-bot

@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar May 15 '24 19:05 facebook-github-bot

@ajkr merged this pull request in facebook/rocksdb@c72ee4531b288bf08b9414155fafb86cc4378fb4.

facebook-github-bot avatar May 22 '24 22:05 facebook-github-bot