Skip to content

Commit 7e9c2b8

Browse files
sakrahakrahdan
andauthored
Make Telemetry Tags Immutable (opensearch-project#20788)
Replace the mutable HashMap-backed Tags with an immutable design using sorted parallel arrays and a precomputed hashCode. Adds allocation-efficient factories (Tags.of, Tags.concat, Tags.fromMap, Tags.toMap), an EMPTY singleton, and content-based equals/hashCode so Tags can be safely used as map keys, stored in fields, and shared across threads. Deprecated API (create(), addTag()) preserved for backward compatibility; addTag() now returns a new instance instead of mutating in place. Fixes AutoForceMergeMetrics which called addTag() without reassigning the return value -- a silent no-op now that Tags is immutable. --------- Signed-off-by: Sam Akrah <sakrah@uber.com> Co-authored-by: Sam Akrah <sakrah@uber.com>
1 parent 3bf2a27 commit 7e9c2b8

File tree

5 files changed

+632
-46
lines changed

5 files changed

+632
-46
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4040
- Added support of WarmerRefreshListener in NRTReplicationEngine to trigger warmer after replication on replica shards ([#20650](https://github.com/opensearch-project/OpenSearch/pull/20650))
4141

4242
### Changed
43+
- Make telemetry `Tags` immutable ([#20788](https://github.com/opensearch-project/OpenSearch/pull/20788))
4344
- Move Randomness from server to libs/common ([#20570](https://github.com/opensearch-project/OpenSearch/pull/20570))
4445
- Use env variable (OPENSEARCH_FIPS_MODE) to enable opensearch to run in FIPS enforced mode instead of checking for existence of bcFIPS jars ([#20625](https://github.com/opensearch-project/OpenSearch/pull/20625))
4546
- Update streaming flag to use search request context ([#20530](https://github.com/opensearch-project/OpenSearch/pull/20530))
4647
- Move pull-based ingestion classes from experimental to publicAPI ([#20704](https://github.com/opensearch-project/OpenSearch/pull/20704))
4748

4849
### Fixed
50+
- Fix `AutoForceMergeMetrics` silently dropping tags due to unreassigned `addTag()` return value ([#20788](https://github.com/opensearch-project/OpenSearch/pull/20788))
4951
- Fix flaky test failures in ShardsLimitAllocationDeciderIT ([#20375](https://github.com/opensearch-project/OpenSearch/pull/20375))
5052
- Prevent criteria update for context aware indices ([#20250](https://github.com/opensearch-project/OpenSearch/pull/20250))
5153
- Update EncryptedBlobContainer to adhere limits while listing blobs in specific sort order if wrapped blob container supports ([#20514](https://github.com/opensearch-project/OpenSearch/pull/20514))

0 commit comments

Comments
 (0)