Skip to content

Bump github.com/opensearch-project/opensearch-go/v4 from 4.6.0 to 4.7.0#82

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/opensearch-project/opensearch-go/v4-4.7.0
Closed

Bump github.com/opensearch-project/opensearch-go/v4 from 4.6.0 to 4.7.0#82
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/opensearch-project/opensearch-go/v4-4.7.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jul 15, 2026

Copy link
Copy Markdown
Contributor

Bumps github.com/opensearch-project/opensearch-go/v4 from 4.6.0 to 4.7.0.

Release notes

Sourced from github.com/opensearch-project/opensearch-go/v4's releases.

v4.7.0

opensearch-go v4.7.0

CRITICAL UPGRADE RELEASE NOTE - The next major release (v5) has substantially expanded error handling capabilities compared to v4.

v4.7.0 is the last v4 release before v5. The v4 -> v5 upgrade changes runtime error-handling behavior and is NOT a drop-in replacement across major versions. If you use this client, read this now - even if you are only upgrading to v4.7.0.

Today, v4 only returns transport-level errors; partial failures (e.g. failed bulk items, failed shards, unconfirmed replica writes) are reported inside the response body, not as Go error values. In v5, those partial failures are returned as errors by default. Code that compiles and passes against v4 can behave differently against v5 without any code change.

Upgrading between v4 releases (any <v4.7.0 to any v4.X.X) does not change the default error-handling semantics. The change lands in v5, which is expected shortly after this release.

This is why v4.7.0 exists: it lets you adopt the v5 error behavior on v4 today - via one environment variable, no code change - so you can validate your error handling before v5 ships and upgrade with no surprises. See Error handling below.

This release covers development from December 2025 through July 2026 (v4.6.0 -> v4.7.0). Three themes dominate the release: a reworked error-handling model that surfaces partial failures as typed Go errors, a rewritten transport layer, and a client-side routing layer that replaces plain round-robin node selection. It also ships a preview of the v5 API surface.

Several of these features are disabled by default in v4 and enabled by default in v5. Each can be turned on in v4 through an environment variable, so users can evaluate the v5 behavior against their own clusters with no code changes before upgrading.

Full Changelog: opensearch-project/opensearch-go@v4.6.0...v4.7.0


1. Error handling

Background

OpenSearch returns HTTP 200 for many operations that only partially succeed: bulk requests where some items fail, searches where some shards error, and writes where a replica fails to confirm. A 2xx status code does not mean the whole operation succeeded.

Before v4.7.0, only transport errors were returned as errors and any partial or shard-level failure required inspecting response fields by hand after every call. v4.7.0 adds a model that turns partial failures into typed Go errors:

Error type Returned by
*PartialBulkError Bulk
*PartialSearchError Search, MSearch, SearchTemplate, Scroll.Get
*ShardFailureError Index, Document.Create, Document.Delete, Update
*MultiSearchItemError MSearch, MSearchTemplate (per sub-response)

Which categories are returned as errors is controlled by a per-category mask on Config.Errors. When a category is masked, the operation returns its response with a nil error even though the response body records failures, and the caller is responsible for inspecting it. When a category is not masked (the default coming in v5), the same partial failure is returned as one of the typed errors above, and the response is still fully populated alongside the error.

v4 -> v5 Migration Path

The default mask in v4 is to mask all errors to preserve the existing v4 behavior of only returning transport errors. The v4.7.0 release exists to catch this change in behavior between v4 and v5 of the library in a forward-compatible way.

Surface Config.Errors == nil means Effect
v4 errmask.All every category masked: partial failures are not returned as errors (preserves pre-4.7 behavior)
v5+ errmask.Empty no category masked: every partial failure is returned as an error

In other words: a v4 program that never sets Config.Errors sees the same silent behavior it always has. The identical program compiled against v5 will begin receiving partial failures as error values. This release lets you adopt the v5 behavior on v4 ahead of time so the upgrade holds no surprises.

Transitioning to v5 error handling

... (truncated)

Changelog

Sourced from github.com/opensearch-project/opensearch-go/v4's changelog.

[4.7.0]

Added

  • Add Close() to opensearch.Client and opensearchapi.Client to release background goroutines (node discovery, health/stats pollers, DNS refresh) and idle connections; opensearchutil.NewBulkIndexer now closes the client it implicitly creates. Backport of #926 without the default-client cache (#928, #893)
  • Add cmd/osgen code generator for typed path builders and API consumer files from the OpenAPI spec
  • v5preview/opensearchapi: NewClient and NewDefaultClient now inject opensearchtransport.NewDefaultRouter when config.Client.Router is nil, opting every v5preview client into intelligent request routing by default. The OPENSEARCH_GO_ROUTER env var preserves its v4 semantics end-to-end: =true/=1 enables auto-discovery (via DiscoverNodesOnStart); =false/=0 suppresses both Router injection and auto-discovery; unset injects the Router without auto-discovery. v4's opensearchapi.NewClient is unchanged. (#816)
  • Add envvars.Falsy(name) helper that distinguishes "explicitly opted out" from "unset" (Truthy collapses both into false). Used by v5preview's router injection rule.
  • Add v5preview/opensearchapi/ package: regenerated v5-track API surface produced by cmd/osgen from the OpenAPI spec. Fully typed Req/Resp/Params structs, sub-clients matching OpenSearch namespaces (client.Cat, client.Cluster, client.Indices, etc.), and a plugins/ subtree for ML/k-NN/security/ISM/etc. Coexists with opensearchapi/ during the v4 -> v5 transition; see v5preview/opensearchapi/README.md for usage and UPGRADING.md for migration guidance (#650)
  • Add primary_terms_map and split_shards_metadata fields to ClusterState index metadata for OpenSearch >=3.6.0 compatibility
  • Add generic opensearch.Do[T]() function for compile-time pointer enforcement on response types, preventing a class of bugs where non-pointer values are silently passed to Client.Do() and fail at runtime during JSON unmarshaling. Includes opensearch.NoBody marker type for calls that expect no response body, unifying all internal dispatch through a single generic path (#809)
  • Add dynamic read cost scoring: primary shard cost scales with write-pool utilization via connScoreFunc, preferring primaries at idle and shedding reads to replicas under write load
  • Add OPENSEARCH_GO_SHARD_COST environment variable and WithShardCosts() router option with r:base/r:amplify/r:exponent curve keys and static cost overrides
  • Add ShardCostConfig field to Config struct for programmatic shard cost override passthrough
  • Add OPENSEARCH_GO_ROUTER environment variable to enable the DefaultRouter without code changes; set to true to opt in (off by default in v4, on by default in v5, removed in v6) (#815)
  • Add client-side metrics guide covering Metrics API, ConnectionMetric, PolicySnapshot, and RouterSnapshot (#812)
  • Add InsecureSkipVerify config option to disable TLS certificate verification without constructing a custom http.Transport, preserving DefaultTransport connection pooling, HTTP/2, and timeout defaults (#786)
  • Add (*opensearchtransport.Client).Stream(*http.Request) (*http.Response, error) and a (*opensearch.Client).Stream passthrough for raw byte forwarding (proxy and streaming use cases). Stream returns the unbuffered response body from RoundTrip; the caller owns reading and closing res.Body. Pairs with opensearch.Do[T] for typed, decoded results (the SDK owns the body). Stream is exposed only on the concrete *Client in v4; v5 will add it to opensearchtransport.Interface and remove the deprecated Perform (#786)
  • Add per-attempt RequestTimeout to bound individual HTTP round-trips, preventing indefinite hangs on stalled connections (#786)
  • Add opensearchutil/shardhash package with exported Hash and ForRouting functions for computing OpenSearch shard routing
  • Enhanced cluster readiness checking for improved test reliability: testutil.NewClient() now includes readiness validation (health + cluster state + nodes info)
  • Add Status field (json.RawMessage) to TasksGetResp, TasksListTask, and TaskCancelInfo for polymorphic task status data; add typed status structs matching the OpenSearch API specification: BulkByScrollTaskStatus, ReplicationTaskStatus, ResyncTaskStatus, PersistentTaskStatus; add Parse* helpers and BulkByScrollTaskStatusOrException for sliced task status (#788)
  • Test parallelization support via TEST_PARALLEL environment variable (default: CPU cores - 1, minimum 1)
  • Add cmd/osgen/emit.TestPerOpErrorTypeName_CatalogConsistency to pin the catalog <-> switch coupling between emit.PerOpErrorTypeName and errwrap.OperationWrappers. Asserts three directions: every group naming a per-op aggregator type has 2+ wrappers in the catalog, every catalog entry with 2+ wrappers names a per-op aggregator type, and every group named by the switch is present in the catalog. Does not pin the runtime emittableWrappers/resolveErrorWrappers paths; today those sets coincide for the only 2+-wrapper groups (msearch / msearch_template) (#857)
  • opensearchapi/testutil package with test suite, client helpers, and JSON comparison utilities
  • Add typed path builders in internal/path/ generated from the OpenAPI spec via cmd/osgen for compile-time URL construction safety (#617, #650)
    • sync.Pool-backed []byte buffers eliminate per-request allocation churn; buffers over 4 KiB are discarded to bound pool growth
  • opensearchtransport/testutil package with PollUntil helper for eventual consistency testing (ISM policies, index readiness, cluster state changes)
  • Configuration option IncludeDedicatedClusterManagers for controlling cluster manager node routing (#765)
  • Policy-based routing system for improved request routing and service availability (#771)
    • Policy interface for composable routing strategies with lifecycle management
    • Router interface with Route() method for request-based connection selection
    • NewPolicy() implementing chain-of-responsibility pattern for composable routing strategies
    • NewIfEnabledPolicy() for conditional routing with runtime evaluation
    • NewMuxPolicy() for trie-based HTTP pattern matching with zero-allocation route lookup
    • NewRolePolicy() for role-based node selection
    • NewRoundRobinRouter() with coordinating node preference and round-robin fallback
    • NewMuxRouter() providing role-based request routing with graceful fallback
      • Automatic routing of bulk, streaming bulk, and reindex operations to ingest nodes
      • Automatic routing of search operations (search, msearch, count, by-query operations, scroll, PIT, validate, rank eval) to search/data nodes
      • Automatic routing of document retrieval operations (get, mget, source, explain, termvectors, mtermvectors) to search/data nodes for read locality
      • Automatic routing of template operations (search template, msearch template) and search shards to search/data nodes
      • Automatic routing of field capabilities to search/data nodes
      • Automatic routing of shard maintenance operations (refresh, flush, synced flush, forcemerge, cache clear, segments) to data nodes
      • Automatic routing of single-document writes (index, create, update, delete) to data nodes
      • Automatic routing of shard diagnostics (recovery, shard stores, stats) and rethrottle operations to data nodes
    • NewDefaultRouter() extending role-based routing with per-index node affinity (recommended for most users)
  • Add consistent hash routing with per-index node affinity for cache locality and AZ-aware load distribution (#786)
    • Rendezvous hashing selects a stable subset of nodes per index, preserving OS page cache and query cache locality
    • RTT-bucketed scoring naturally prefers AZ-local nodes and overflows to remote AZs under load

... (truncated)

Commits
  • f818ecb chore: update go.mod and go.sum dependencies (#960)
  • 81027f8 fix(opensearchtransport): gate single-node pool on reachability so seed fallb...
  • 6c064a4 fix(opensearchtransport): don't let unverified discovered nodes mask seed fal...
  • 6a3f31b chore(deps): bump actions/upload-artifact from 5.0.0 to 7.0.1 (#937)
  • f28c9db chore(deps): bump stefanzweifel/git-auto-commit-action (#944)
  • b204729 chore(deps): bump VachaShah/backport from 1.1.4 to 2.2.0 (#943)
  • d64cdb1 chore(deps): bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 (#936)
  • db27130 chore(deps): bump lycheeverse/lychee-action from 2.7.0 to 2.9.0 (#939)
  • 8f39786 chore(deps): bump golang.org/x/sync from 0.21.0 to 0.22.0 (#941)
  • d272ddc chore(deps): bump golang.org/x/mod from 0.37.0 to 0.38.0 (#948)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/opensearch-project/opensearch-go/v4](https://github.com/opensearch-project/opensearch-go) from 4.6.0 to 4.7.0.
- [Release notes](https://github.com/opensearch-project/opensearch-go/releases)
- [Changelog](https://github.com/opensearch-project/opensearch-go/blob/v4.7.0/CHANGELOG.md)
- [Commits](opensearch-project/opensearch-go@v4.6.0...v4.7.0)

---
updated-dependencies:
- dependency-name: github.com/opensearch-project/opensearch-go/v4
  dependency-version: 4.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Dependency updates go Go module update labels Jul 15, 2026
@dependabot
dependabot Bot requested a review from dj-wasabi as a code owner July 15, 2026 18:15
@dependabot dependabot Bot added dependencies Dependency updates go Go module update labels Jul 15, 2026
@dependabot @github

dependabot Bot commented on behalf of github Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #85.

@dependabot dependabot Bot closed this Jul 22, 2026
@dependabot
dependabot Bot deleted the dependabot/go_modules/github.com/opensearch-project/opensearch-go/v4-4.7.0 branch July 22, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates go Go module update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants