Skip to content

Extract WaitAckCache to deduplicate OpenSearch bulk response handling#1869

Open
jnioche wants to merge 4 commits intomainfrom
refactor/opensearch-waitack-cache
Open

Extract WaitAckCache to deduplicate OpenSearch bulk response handling#1869
jnioche wants to merge 4 commits intomainfrom
refactor/opensearch-waitack-cache

Conversation

@jnioche
Copy link
Copy Markdown
Contributor

@jnioche jnioche commented Apr 4, 2026

Summary

  • Extracts duplicated waitAck cache and bulk response processing logic from DeletionBolt, IndexerBolt, and StatusUpdaterBolt into a new shared WaitAckCache class
  • Reduces ~595 lines of duplicated code across the three bolts into a single reusable component with bolt-specific callbacks
  • Adds 11 unit tests for WaitAckCache covering success, failure, conflicts, eviction, duplicate doc IDs (Elasticsearch IndexerBolt: tuples with canonical URL may not get acked #832), and edge cases — no OpenSearch container needed

Test plan

  • mvn test -pl external/opensearch -Dtest=WaitAckCacheTest — all 11 new unit tests pass
  • mvn compile -pl external/opensearch -am — clean compile
  • Existing integration tests (IndexerBoltTest, StatusBoltTest) pass against OpenSearch container

🤖 Generated with Claude Code

…rch bolts

The waitAck cache logic and bulk response processing were duplicated across
DeletionBolt, IndexerBolt, and StatusUpdaterBolt. This extracts the shared
logic into a new WaitAckCache class and adds unit tests covering the core
scenarios (success, failure, conflicts, eviction, duplicate doc IDs).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jnioche jnioche added this to the 3.6.0 milestone Apr 4, 2026
Signed-off-by: Julien Nioche <julien@digitalpebble.com>
jnioche added 2 commits April 4, 2026 15:21
Signed-off-by: Julien Nioche <julien@digitalpebble.com>
… working in my spare time)

Signed-off-by: Julien Nioche <julien@digitalpebble.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant