Skip to content

Commit a2f95ce

Browse files
authored
Fixing SearchStats (de)serialization (#4697)
Fixes bwc failure caused by commit 6993ac9. Signed-off-by: Andriy Redko <[email protected]>
1 parent ed359f0 commit a2f95ce

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
119119
- Attempt to fix Github workflow for Gradle Check job ([#4679](https://github.com/opensearch-project/OpenSearch/pull/4679))
120120
- Fix flaky DecommissionControllerTests.testTimesOut ([4683](https://github.com/opensearch-project/OpenSearch/pull/4683))
121121
- Fix new race condition in DecommissionControllerTests ([4688](https://github.com/opensearch-project/OpenSearch/pull/4688))
122+
- Fix SearchStats (de)serialization (caused by https://github.com/opensearch-project/OpenSearch/pull/4616) ([#4697](https://github.com/opensearch-project/OpenSearch/pull/4697))
122123

123124
### Security
124125

rest-api-spec/src/main/resources/rest-api-spec/test/cat.shards/10_basic.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
"Help":
33
- skip:
4-
version: " - 2.9.99"
5-
reason: point in time stats were added in 3.0.0
4+
version: " - 2.3.99"
5+
reason: point in time stats were added in 2.4.0
66
features: node_selector
77
- do:
88
cat.shards:
99
help: true
1010
node_selector:
11-
version: "3.0.0 - "
11+
version: "2.4.0 - "
1212

1313
- match:
1414
$body: |
@@ -88,16 +88,16 @@
8888
path.state .+ \n
8989
$/
9090
---
91-
"Help before - 3.0.0":
91+
"Help before - 2.4.0":
9292
- skip:
93-
version: "3.0.0 - "
94-
reason: point in time stats were added in 3.0.0
93+
version: "2.4.0 - "
94+
reason: point in time stats were added in 2.4.0
9595
features: node_selector
9696
- do:
9797
cat.shards:
9898
help: true
9999
node_selector:
100-
version: " - 2.9.99"
100+
version: " - 2.3.99"
101101

102102
- match:
103103
$body: |

rest-api-spec/src/main/resources/rest-api-spec/test/pit/10_basic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"Create PIT, Search with PIT ID and Delete":
22
- skip:
3-
version: " - 2.9.99"
4-
reason: "mode to be introduced later than 3.0"
3+
version: " - 2.3.99"
4+
reason: "mode to be introduced later than 2.4.0"
55
- do:
66
indices.create:
77
index: test_pit

server/src/main/java/org/opensearch/index/search/stats/SearchStats.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private Stats(StreamInput in) throws IOException {
141141
suggestTimeInMillis = in.readVLong();
142142
suggestCurrent = in.readVLong();
143143

144-
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
144+
if (in.getVersion().onOrAfter(Version.V_2_4_0)) {
145145
pitCount = in.readVLong();
146146
pitTimeInMillis = in.readVLong();
147147
pitCurrent = in.readVLong();
@@ -292,7 +292,7 @@ public void writeTo(StreamOutput out) throws IOException {
292292
out.writeVLong(suggestTimeInMillis);
293293
out.writeVLong(suggestCurrent);
294294

295-
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
295+
if (out.getVersion().onOrAfter(Version.V_2_4_0)) {
296296
out.writeVLong(pitCount);
297297
out.writeVLong(pitTimeInMillis);
298298
out.writeVLong(pitCurrent);

0 commit comments

Comments
 (0)