aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-06-17 12:50:35 +0000
committerArne Juul <arnej@verizonmedia.com>2020-06-17 13:15:40 +0000
commit24f3af2b0d89353dd13c73f29261d40b59fa7e0d (patch)
treee802ba8f93b0c77528e2225b2a124fd301055957 /searchlib
parent1da494f6f83b0c506170518e5ed6caa090f752c7 (diff)
also check graph symmetry
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp
index ea443cfe252..fa6f760a33f 100644
--- a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp
+++ b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp
@@ -12,7 +12,6 @@
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/util/blockingthreadstackexecutor.h>
-#include <vespa/vespalib/util/gate.h>
#include <vespa/vespalib/util/lambdatask.h>
#include <vector>
@@ -352,6 +351,10 @@ TEST_F(Stressor, stress)
gen_operation();
if (i % 1000 == 0) {
fprintf(stderr, "generating operations %d / %d\n", i, NUM_OPS);
+ auto r = write_thread.execute(vespalib::makeLambdaTask([&]() {
+ EXPECT_TRUE(index->check_link_symmetry());
+ }));
+ EXPECT_EQ(bool(r), false);
}
}
fprintf(stderr, "waiting for queued operations...\n");
@@ -359,6 +362,7 @@ TEST_F(Stressor, stress)
write_thread.sync();
in_progress->invalidateCachedCount();
EXPECT_EQ(in_progress->countTrueBits(), 0);
+ EXPECT_TRUE(index->check_link_symmetry());
fprintf(stderr, "all done.\n");
}
diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
index d78c7a64c89..c9474eaf483 100644
--- a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
@@ -620,6 +620,8 @@ HnswIndex::check_link_symmetry() const
auto neighbor_links = _graph.get_link_array(neighbor_docid, level);
if (! has_link_to(neighbor_links, docid)) {
all_sym = false;
+ LOG(warning, "check_link_symmetry: docid %zu links to %u on level %u, but no backlink",
+ docid, neighbor_docid, level);
}
}
++level;