Fix BYTES_WRITTEN accounting

Summary:
BYTES_WRITTEN accounting doesn't work with disabled WAL. For example, this is what we
get in the LOG:

```
Cumulative writes: 9794K writes, 228M keys, 9794K commit groups, 1.0
writes per commit group, ingest: 0.00 GB, 0.00 MB/s
```

WAL bytes are tracked in a different statistic:
https://github.com/facebook/rocksdb/blob/master/db/internal_stats.h#L105.
BYTES_WRITTEN should count all the writes.
Closes https://github.com/facebook/rocksdb/pull/2133

Differential Revision: D4880615

Pulled By: yiwu-arbug

fbshipit-source-id: 8fd0b223099f3f5ad7df79d4e737d313687fec69
This commit is contained in:
Igor Canadi 2017-04-13 11:58:44 -07:00 committed by Facebook Github Bot
parent 13369fbd4a
commit b6b9359ece
1 changed files with 2 additions and 4 deletions

View File

@ -163,10 +163,8 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options,
parallel = parallel && !writer->batch->HasMerge();
}
if (writer->ShouldWriteToWAL()) {
total_byte_size = WriteBatchInternal::AppendedByteSize(
total_byte_size, WriteBatchInternal::ByteSize(writer->batch));
}
total_byte_size = WriteBatchInternal::AppendedByteSize(
total_byte_size, WriteBatchInternal::ByteSize(writer->batch));
}
}