summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-08-07 15:24:56 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-08-07 15:24:56 +0000
commitb6403280123a037a88182dded27e37cad3f6a6ac (patch)
treeb536744c152de3e6863538dc5480de5289069c9f /storage
parent5c54ec89c79ad8df26297e6f5192ae1f2f23f3bd (diff)
Add some more info to test and set error message.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/persistence/testandsethelper.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/persistence/testandsethelper.cpp b/storage/src/vespa/storage/persistence/testandsethelper.cpp
index e1909252c8f..ed396cd522e 100644
--- a/storage/src/vespa/storage/persistence/testandsethelper.cpp
+++ b/storage/src/vespa/storage/persistence/testandsethelper.cpp
@@ -5,6 +5,7 @@
#include <vespa/storage/persistence/testandsethelper.h>
#include <vespa/document/select/parser.h>
#include <vespa/document/repo/documenttyperepo.h>
+#include <vespa/vespalib/util/stringfmt.h>
using namespace std::string_literals;
@@ -45,6 +46,7 @@ TestAndSetHelper::TestAndSetHelper(PersistenceThread & thread, const api::TestAn
_component(thread._env._component),
_cmd(cmd),
_docId(cmd.getDocumentId()),
+ _docTypePtr(nullptr),
_missingDocumentImpliesMatch(missingDocumentImpliesMatch)
{
getDocumentType();
@@ -66,7 +68,10 @@ TestAndSetHelper::retrieveAndMatch(spi::Context & context) {
if (result.hasDocument()) {
auto docPtr = result.getDocumentPtr();
if (_docSelectionUp->contains(*docPtr) != document::select::Result::True) {
- return api::ReturnCode(api::ReturnCode::TEST_AND_SET_CONDITION_FAILED, "Condition did not match document");
+ return api::ReturnCode(api::ReturnCode::TEST_AND_SET_CONDITION_FAILED,
+ vespalib::make_string("Condition did not match document partition=%d, nodeIndex=%d bucket=%lx %s",
+ _thread._env._partition, _thread._env._nodeIndex, _cmd.getBucketId().getRawId(),
+ _cmd.hasBeenRemapped() ? "remapped" : ""));
}
// Document matches
@@ -75,7 +80,10 @@ TestAndSetHelper::retrieveAndMatch(spi::Context & context) {
return api::ReturnCode();
}
- return api::ReturnCode(api::ReturnCode::TEST_AND_SET_CONDITION_FAILED, "Document does not exist");
+ return api::ReturnCode(api::ReturnCode::TEST_AND_SET_CONDITION_FAILED,
+ vespalib::make_string("Document does not exist partition=%d, nodeIndex=%d bucket=%lx %s",
+ _thread._env._partition, _thread._env._nodeIndex, _cmd.getBucketId().getRawId(),
+ _cmd.hasBeenRemapped() ? "remapped" : ""));
}
} // storage