summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-09-04 17:04:38 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-09-04 17:04:38 +0000
commit5745c49d51be94c25f1f54774d74e89cb342dcc1 (patch)
tree954ebb1387dac14e8319e6a240a959bc8082d536
parent85d23f4f7b45fdf807dc958669d443781a8e4d53 (diff)
We are already tracking write position.
-rw-r--r--searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp
index 729a3171556..96e75c35a81 100644
--- a/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp
+++ b/searchlib/src/vespa/searchlib/transactionlog/domainpart.cpp
@@ -542,14 +542,12 @@ DomainPart::write(FastOS_FileInterface &file, const IChunk & chunk)
os << realEncoding.getRaw(); //Patching real encoding
os << uint32_t(end - (begin + sizeof(uint32_t) + sizeof(uint8_t))); // Patching actual size.
os.wp(end);
- int64_t lastKnownGoodPos(file.GetPosition());
LockGuard guard(_writeLock);
if ( ! file.CheckedWrite(os.data(), os.size()) ) {
- throw runtime_error(handleWriteError("Failed writing the entry.", file, lastKnownGoodPos, chunk.range(), os.size()));
+ throw runtime_error(handleWriteError("Failed writing the entry.", file, byteSize(), chunk.range(), os.size()));
}
_writtenSerial = chunk.range().to();
- assert(size_t(lastKnownGoodPos) == byteSize());
- _byteSize.store(lastKnownGoodPos + os.size(), std::memory_order_release);
+ _byteSize.fetch_add(os.size(), std::memory_order_release);
}
bool