Skip to content

fix(redis): Preserve shared Redis index hashes when dropping a storage#1942

Open
vdusek wants to merge 1 commit into
masterfrom
fix/redis-drop-index-hdel
Open

fix(redis): Preserve shared Redis index hashes when dropping a storage#1942
vdusek wants to merge 1 commit into
masterfrom
fix/redis-drop-index-hdel

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented Jun 3, 2026

Description

RedisClientMixin._drop called pipe.delete(f'{MAIN_KEY}:id_to_name', storage_id) (and the same for name_to_id), but Redis DEL deletes whole top-level keys — it does not remove a field from a hash. Since id_to_name and name_to_id are shared hashes holding the mappings for every storage of a given type, dropping any single Dataset/KVS/RequestQueue wiped the entire index, breaking subsequent open(id=...) calls for all sibling storages (open-by-name kept working, since it reads metadata directly).

This replaces the two DEL calls with HDEL, removing only the dropped storage's fields, and adds a regression test verifying that a sibling storage's index entries survive a drop and that it can still be opened by ID.

`RedisClientMixin._drop` used `DEL` on the shared `id_to_name` and
`name_to_id` index hashes, wiping the id/name mappings of every other
storage of the same type and breaking subsequent open-by-ID calls.
Use `HDEL` to remove only the dropped storage's fields.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Jun 3, 2026
@vdusek vdusek self-assigned this Jun 3, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 3, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.95%. Comparing base (dc1ed61) to head (caf3f6a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1942      +/-   ##
==========================================
+ Coverage   92.85%   92.95%   +0.10%     
==========================================
  Files         167      167              
  Lines       11714    11714              
==========================================
+ Hits        10877    10889      +12     
+ Misses        837      825      -12     
Flag Coverage Δ
unit 92.95% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@vdusek vdusek changed the title fix: Preserve shared Redis index hashes when dropping a storage fix(redis): Preserve shared Redis index hashes when dropping a storage Jun 3, 2026
@vdusek vdusek requested a review from Mantisus June 3, 2026 18:00
@vdusek vdusek marked this pull request as ready for review June 3, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants