Skip to content

Commit

Permalink
[Port main] update version check as per v2.11.0
Browse files Browse the repository at this point in the history
[Backport 2.x] Indexing: add Doc status counter (#10267)

* Indexing: add Doc Status Counter (#8716)

Currently, Opensearch returns a 200 OK response code for a Bulk API
call, even though there can be partial/complete failures within the
request E2E. This provides doc level stats with respect to the rest status code as 2xx, 4xx, 5xx etc.

Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
(cherry picked from commit d656e3d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 94173e3)
Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
  • Loading branch information
sgup432 committed Sep 29, 2023
1 parent b29a6fd commit 22149bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
---
"Metric - indexing doc_status":
- skip:
version: " - 2.99.99"
reason: "To be introduced in future release :: TODO: change if/when we backport to 2.x"
version: " - 2.10.99"
reason: "Doc Status Stats were introduced in v2.11.0"
- do:
nodes.info: {}
- set:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public Stats(StreamInput in) throws IOException {
isThrottled = in.readBoolean();
throttleTimeInMillis = in.readLong();

if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_11_0)) {
docStatusStats = in.readOptionalWriteable(DocStatusStats::new);
} else {
docStatusStats = null;
Expand Down Expand Up @@ -308,7 +308,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(isThrottled);
out.writeLong(throttleTimeInMillis);

if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_11_0)) {
out.writeOptionalWriteable(docStatusStats);
}
}
Expand Down

0 comments on commit 22149bc

Please sign in to comment.