diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-07 18:05:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 18:05:48 +0200 |
commit | dc10b82a2e54294752f85c4949229424a07cbe94 (patch) | |
tree | b536744c152de3e6863538dc5480de5289069c9f /storage | |
parent | 5c54ec89c79ad8df26297e6f5192ae1f2f23f3bd (diff) | |
parent | b6403280123a037a88182dded27e37cad3f6a6ac (diff) |
Merge pull request #14012 from vespa-engine/balder/add-partition-and-nodeindex-to-message
Add some more info to test and set error message.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/src/vespa/storage/persistence/testandsethelper.cpp | 12 |
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 |