kv/kvserver: Remove buffering from SSTSnapshotStorageFile
When investigating a durability violation around ingested sstables that disappeared after a power outage, we realized that SSTSnapshotStorageFile does not flush its buffer before doing a Sync(). When used with a pebble SSTWriter, we expect Sync() to ensure all bytes written to that file are synced to disk, which is not what was happening here for the last couple bytes written to the buffer. This change removes buffering from SSTSnapshotStorageFile as pebble's SST writer already does its own buffering. This makes Sync() do what it is expected to do. Release note (bug fix): Fix a bug where a badly timed power outage or system crash could result in an error upon process restart.
Showing with 25 additions and 34 deletions