From b6b9359ececa1efed20f11c36cb5e9b9f031819f Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 13 Apr 2017 11:58:44 -0700 Subject: [PATCH] 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 --- db/db_impl_write.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/db/db_impl_write.cc b/db/db_impl_write.cc index b2f4c7e3a4..6aa5003e45 100644 --- a/db/db_impl_write.cc +++ b/db/db_impl_write.cc @@ -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)); } }