Skip to content

CMR-11271: Fix Cascade collection delete does not delete from index-set when index is separate from small_collections - #2474

Merged
jaortega527 merged 14 commits into
masterfrom
CMR-11271
Aug 7, 2026
Merged

CMR-11271: Fix Cascade collection delete does not delete from index-set when index is separate from small_collections#2474
jaortega527 merged 14 commits into
masterfrom
CMR-11271

Conversation

@jaortega527

Copy link
Copy Markdown
Contributor

Overview

What is the objective?

Ensure that deleting a collection with a separate granule index also removes the corresponding mapping from the index set, avoiding recreation of deleted indexes and preventing invalid rebalancing attempts.

What are the changes?

  • Added HTTP status information for individual granule-index deletions in delete-granule-index. Added unit tests to confirm behavior.
  • Updated cascade-collection-delete to remove the index-set mapping only when ES returns 200 or 404. If the underlying index deletion in ES fails, the index-set is not updated. Added unit tests to confirm behavior.
  • Added remove-collection-granule-index-if-exists to remove and persist the deletion of the of the separate granule-index mapping. It also handles missing mappings and collections included in small_collections. Added unit tests to confirm behavior.
  • Added integration test to verify that separate index is deleted when cascade-collection-delete is called
  • Added integration test to verify that a deleted collection does not rebalance after its separate index mapping is removed

What areas of the application does this impact?

  • indexer-app
  • system-int-test

Required Checklist

  • New and existing unit and int tests pass locally and remotely
  • clj-kondo has been run locally and all errors in changed files are corrected
  • I have commented my code, particularly in hard-to-understand areas
  • I have made changes to the documentation (if necessary)
  • My changes generate no new warnings

Additional Checklist

  • I have removed unnecessary/dead code and imports in files I have changed
  • I have cleaned up integration tests by doing one or more of the following:
    • migrated any are2 tests to are3 in files I have changed
    • de-duped, consolidated, removed dead int tests
    • transformed applicable int tests into unit tests
    • reduced number of system state resets by updating fixtures. Ex) (use-fixtures :each (ingest/reset-fixture {})) to be :once instead of :each

@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.93%. Comparing base (fbf36b6) to head (2277f95).

Files with missing lines Patch % Lines
...xer-app/src/cmr/indexer/services/index_service.clj 14.28% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2474      +/-   ##
==========================================
+ Coverage   57.91%   57.93%   +0.01%     
==========================================
  Files        1074     1074              
  Lines       74696    74714      +18     
  Branches     2175     2186      +11     
==========================================
+ Hits        43263    43288      +25     
+ Misses      29404    29381      -23     
- Partials     2029     2045      +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread indexer-app/test/cmr/indexer/test/services/index_set_service_test.clj Outdated
Comment thread indexer-app/test/cmr/indexer/test/services/index_set_service_test.clj Outdated
Comment thread indexer-app/test/cmr/indexer/test/services/index_set_service_test.clj Outdated
Comment thread indexer-app/test/cmr/indexer/test/services/index_set_service_test.clj Outdated
Comment thread indexer-app/test/cmr/indexer/test/services/index_set_service_test.clj Outdated
Comment thread indexer-app/src/cmr/indexer/services/index_set_service.clj
Comment thread indexer-app/src/cmr/indexer/services/index_set_service.clj Outdated
Comment thread indexer-app/src/cmr/indexer/services/index_set_service.clj Outdated
Comment thread indexer-app/src/cmr/indexer/services/index_set_service.clj Outdated
Comment thread indexer-app/src/cmr/indexer/services/index_service.clj Outdated
Comment thread indexer-app/test/cmr/indexer/test/data/elasticsearch.clj Outdated
Comment thread indexer-app/test/cmr/indexer/test/services/index_service.clj
Comment thread indexer-app/test/cmr/indexer/test/services/index_service.clj
Comment thread indexer-app/test/cmr/indexer/test/services/index_service.clj
…anule index from index-set if it is a separate index and not in small_cllections
…llections-test to expect the 400 error returned because the deleted index no longer has an entry in the index-set
… the existing delete-index-set-indices behavior and remove its associated tests. These changes were unintentionally included and are outside the scope of the collection granule index-set cleanup.
…on-granule-index-if-exists once we confirm the status from the call to delete-granule-index is 200 or 404
…ollection-granule-index-if-exists` to be called, but verify the index-set is in the expected state.
… add a docstring for the test helper method and review and improve test descriptions
…moved the setup into the testing section and renamed to use "When...Then..." format.
@jaortega527
jaortega527 merged commit faf2512 into master Aug 7, 2026
6 checks passed
@jaortega527
jaortega527 deleted the CMR-11271 branch August 10, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants