Fix recycled WAL detection when wal_compression is enabled
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 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@ajkr has updated the pull request. You must reimport the pull request before landing.
@ajkr has updated the pull request. You must reimport the pull request before landing.
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@ajkr merged this pull request in facebook/rocksdb@c72ee4531b288bf08b9414155fafb86cc4378fb4.