1
0
Fork 0

Fix ArangoSearch consolidation results commit (3.5 backport) (#10370)

* Fix ported from upstream

* Update CHANGELOG
This commit is contained in:
Dronplane 2019-11-06 13:07:15 +03:00 committed by KVS85
parent b186aebd8d
commit 89b21f3c73
2 changed files with 15 additions and 1 deletions

View File

@ -2038,6 +2038,11 @@ index_writer::pending_context_t index_writer::flush_all(const before_commit_f& b
// pending consolidation request
pending_candidates_count += candidates.size();
} else {
// during consolidation doc_mask could be already populated even for just merged segment
if (pending_segment.segment.meta.docs_count != pending_segment.segment.meta.live_docs_count) {
index_utils::read_document_mask(docs_mask, dir, pending_segment.segment.meta);
}
bool docs_mask_modified = false;
// pending already imported/consolidated segment, apply deletes
// mask documents matching filters from segment_contexts (i.e. from new operations)
for (auto& modifications: ctx->pending_segment_contexts_) {
@ -2052,7 +2057,7 @@ index_writer::pending_context_t index_writer::flush_all(const before_commit_f& b
modifications_end - modifications_begin
);
add_document_mask_modified_records(
docs_mask_modified |= add_document_mask_modified_records(
modification_queries,
docs_mask,
cached_readers_, // reader cache for segments
@ -2060,6 +2065,11 @@ index_writer::pending_context_t index_writer::flush_all(const before_commit_f& b
pending_segment.generation
);
}
// if mask left untouched, reset it, to prevent unnecessary writes
if (!docs_mask_modified) {
docs_mask.clear();
}
}
// skip empty segments

View File

@ -1,6 +1,10 @@
v3.5.3 (XXXX-XX-XX)
-------------------
* Fixed ArangoSearch index removes being discarded on commiting consolidation
results with pending removes after some segments under consolidation were
already committed.
* Assertion fail when no timestamp in agency's persistence.
* Fixed internal issue #647: custom analyzer provokes errors on Active Failover