diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-11-06 14:19:40 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-11-06 14:19:40 +0000 |
commit | 8002a4ddc2375057f37c77d8071fce8b4c79c837 (patch) | |
tree | 03a4da703a01b51c9d1295115e4c52a954fca750 /searchcore | |
parent | e4db73ea086bf4d474c6acef577743df76d49c20 (diff) |
Avoid trying to shrink an attribute if it is smaller than expected,
e.g. due to later config changes removing the attribute causing
less information to be available during transaction log replay.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp index 906f71fecb4..7413d0f369f 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp @@ -143,7 +143,15 @@ applyCompactLidSpace(uint32_t wantedLidLimit, SerialNum serialNum, AttributeVector &attr) { if (attr.getStatus().getLastSyncToken() < serialNum) { - attr.compactLidSpace(wantedLidLimit); + /* + * If the attribute is an empty placeholder attribute due to + * later config changes removing the attribute then it might + * be smaller than expected during transaction log replay. + */ + attr.commit(); + if (wantedLidLimit <= attr.getCommittedDocIdLimit()) { + attr.compactLidSpace(wantedLidLimit); + } attr.commit(serialNum, serialNum); } } |