Skip to content

redis: preserve owner key when foreign restore fails (#2181) - #2204

Draft
darwvin-dev wants to merge 1 commit into
sipwise:masterfrom
darwvin-dev:fix/foreign-redis-restore-preserve-owner-2181
Draft

darwvin-dev wants to merge 1 commit into
sipwise:masterfrom
darwvin-dev:fix/foreign-redis-restore-preserve-owner-2181

Conversation

@darwvin-dev

Copy link
Copy Markdown
Contributor

Problem

When a Redis keyspace subscriber fails to restore a foreign call (for example, the subscriber lacks the owner's third logical interface), json_restore_call() currently deletes the persisted key through the failed call cleanup and unconditional DEL commands. A misconfigured subscriber can therefore destroy the healthy owner's recoverable state.

Change

  • In the failed foreign-restore branch, set the incomplete local call's redis_hosted_db to the non-persisted sentinel before call_destroy() so it cannot delete an owner's key.
  • Issue Redis DEL cleanup only for a failed local restore, never a failed foreign restore.
  • Log the retained foreign key when restoration fails.

Test plan (not yet performed)

  • Run a three-node Redis/Valkey HA setup: A writes an offer using pub2, C subscribes but lacks pub2. Confirm C restore fails yet the owner's key remains present and A's recovery is unaffected.
  • Repeat for a valid three-interface subscriber; confirm ordinary propagation and takeover.
  • Verify local-owner restore failure still cleans local bad records.
  • Run daemon build and Redis integration tests.

Draft until multi-node HA tests validate correctness. Related to #2181.


Upstream submission notes

This is a draft, carried from contributor fork PR darwvin-dev/rtpengine#3.
Unfinished validation: Please refer to the outstanding build, runtime, regression and/or integration tests above. No claim is made that these checks passed. Review for compatibility and completeness before marking ready.
The source branch is behind current upstream master and may require reconciliation before merging.

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.

1 participant