Skip to content

Add Metadata.GetReplicas APIs With Table Name (Tablet-Compatible) #197

@sylwiaszunejko

Description

@sylwiaszunejko

Background

The current replica resolution APIs exposed by Metadata:

public ICollection<HostShard> GetReplicas(string keyspaceName, byte[] partitionKey)
public ICollection<HostShard> GetReplicas(byte[] partitionKey)

were inherited from the original DataStax driver API. These methods determine replicas without requiring a table name.

This design predates tablet-based replication used in modern ScyllaDB clusters.

Problem

Replica resolution in ScyllaDB can depend on tablet metadata, which is defined per table. Without the table name, the driver cannot correctly resolve replicas when tablets are used.

Because the current C# APIs do not accept a table name, the tablet-based path cannot be used. This effectively forces replica resolution to assume vnode-based replication, which is incorrect for tablet-enabled clusters.

Proposed Solution

Deprecate existing APIs

public ICollection<HostShard> GetReplicas(string keyspaceName, byte[] partitionKey)
public ICollection<HostShard> GetReplicas(byte[] partitionKey)

These APIs cannot correctly support tablet-aware replica resolution.

Introduce new APIs requiring a table name

Example proposal:

public ICollection<HostShard> GetReplicas(string keyspaceName, string tableName, byte[] partitionKey)

This allows the driver to:

  • Look up (keyspace, table) in tablet metadata

  • Correctly resolve replicas for tablet-based replication

  • Fall back to replication strategies when tablets are not present

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions