Skip to content

Commit 19550a8

Browse files
authored
Add dense vector off-heap stats to Node stats and Index stats APIs (#126704)
This change enhances the dense_vector section of the Nodes stats and Index stats APIs so that they report the desired size of off-heap memory for all indexed vectors. The dense_vector section of the Custer stats API remains unchanged. The retrieval mechanism and structure of the new stats is the same across the various three stats APIs, but more fine-grained information is disclosed as when moving from Cluster -> Node -> Index API. For Node stats, we aggregate the total byte sizes for all vectors, categorised by the data type. For example: "dense_vector" : { "value_count" : 5, "off_heap" : { "total_size_in_bytes" : 27, "total_veb_size_in_bytes" : 3, "total_vec_size_in_bytes" : 23, "total_veq_size_in_bytes" : 0, "total_vex_size_in_bytes" : 1 } } Index stats: same as Node stats with included field break down . For example: "dense_vector" : { "value_count" : 5, "off_heap" : { "total_size_in_bytes" : 27, "total_veb_size_in_bytes" : 3, "total_vec_size_in_bytes" : 23, "total_veq_size_in_bytes" : 0, "total_vex_size_in_bytes" : 1, "fielddata" : { "bar" : { "veb_size_in_bytes" : 3, "vec_size_in_bytes" : 14, "vex_size_in_bytes" : 1 }, "foo" : { "vec_size_in_bytes" : 9 } } } The implementation accesses the actual statistics through reflection. This will be completely removed when Lucene exposes this, which is expected in Lucene 10.3
1 parent 9da92d6 commit 19550a8

File tree

33 files changed

+2128
-36
lines changed

33 files changed

+2128
-36
lines changed

distribution/tools/server-cli/src/main/java/org/elasticsearch/server/cli/SystemJvmOptions.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, St
6161
"-Dio.netty.noUnsafe=true",
6262
"-Dio.netty.noKeySetOptimization=true",
6363
"-Dio.netty.recycler.maxCapacityPerThread=0",
64+
// temporary until we get off-heap vector stats in Lucene 10.3
65+
"--add-opens=org.apache.lucene.core/org.apache.lucene.codecs.lucene99=org.elasticsearch.server",
66+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene90=org.elasticsearch.server",
67+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene91=org.elasticsearch.server",
68+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene92=org.elasticsearch.server",
69+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene94=org.elasticsearch.server",
70+
"--add-opens=org.apache.lucene.backward_codecs/org.apache.lucene.backward_codecs.lucene95=org.elasticsearch.server",
6471
// log4j 2
6572
"-Dlog4j.shutdownHookEnabled=false",
6673
"-Dlog4j2.disable.jmx=true",

docs/changelog/126704.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126704
2+
summary: Add dense vector off-heap stats to Node stats and Index stats APIs
3+
area: "Vector Search"
4+
type: enhancement
5+
issues: []

qa/ccs-common-rest/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ apply plugin: 'elasticsearch.internal-yaml-rest-test'
1010

1111
restResources {
1212
restApi {
13-
include 'capabilities', '_common', 'bulk', 'count', 'cluster', 'field_caps', 'get', 'knn_search', 'index', 'indices', 'msearch',
14-
'search', 'async_search', 'graph', '*_point_in_time', 'info', 'scroll', 'clear_scroll', 'search_mvt', 'eql', 'sql'
13+
include 'capabilities', 'cat.shards', '_common', 'bulk', 'count', 'cluster', 'field_caps', 'get', 'knn_search', 'index', 'indices', 'msearch',
14+
"nodes.stats", 'search', 'async_search', 'graph', '*_point_in_time', 'info', 'scroll', 'clear_scroll', 'search_mvt', 'eql', 'sql'
1515
}
1616
restTests {
1717
includeCore 'field_caps', 'msearch', 'search', 'suggest', 'scroll', "indices.resolve_index"

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.stats/10_basic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@
351351
- match: { indices.docs.count: 5 }
352352
- match: { indices.docs.deleted: 0 }
353353
- match: { indices.dense_vector.value_count: 8 }
354+
- is_false: indices.dense_vector.off_heap
354355

355356
---
356357
"Sparse vector stats":

0 commit comments

Comments
 (0)