Skip to content

cluster cascade delete does not filter by ownership on remote nodes #22

@fabracht

Description

@fabracht

Problem

Owner-aware cascade filtering (PR #21) only applies to entities on the local node's primary partitions. Remote nodes return all referencing IDs without ownership checks because the FkReverseLookupRequest wire protocol doesn't carry sender or owner_field information.

Impact

In a multi-node cluster, if a cross-owned entity's partition primary is on a remote node, it will be blindly cascade-deleted despite ownership protection being configured.

Root Cause

  • handle_fk_reverse_lookup_request in fk.rs returns all primary-partition refs without checking ownership
  • FkReverseLookupRequest protocol (protocol/fk.rs) has no sender/owner_field fields
  • await_fk_reverse_lookups hardcodes cross_owned_ids: Vec::new() for remote results

Fix

Bump FkReverseLookupRequest to V2 with sender and owner_field fields. Apply partition_refs_by_ownership in handle_fk_reverse_lookup_request. Return cross_owned_ids in FkReverseLookupResponse V2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions