Skip to content

[Phase 5/6] GSI independent placement — own shards, own RF #514

Description

Part of epic #509. Depends on Phase 1.

Goal

A global index can declare `WITH SHARDS=N REPLICATION_FACTOR=R` so its storage / RF differs from the base. Useful when the indexed value's distribution differs sharply from the base's (e.g. base is high-cardinality user IDs, index is on a low-cardinality status enum).

Files

  • `internal/placement/placement.go` — extend per-MV placement model from [Phase 5/7] MV independent placement — own shards, own RF #494 to support per-index placement.
  • `internal/cluster/manager.go` — open index shards alongside base shards.
  • `pkg/types/types.go` — `GlobalIndexDescriptor.Shards / ReplicationFactor`.
  • `internal/sql/parser.go` — extend `CREATE INDEX AS GLOBAL ... WITH SHARDS=N REPLICATION_FACTOR=R`.

DoD

  • Index with `WITH SHARDS=4 REPLICATION_FACTOR=2` opens 4 raft groups distinct from base.
  • No regression for indexes that omit the placement clause.

Tier

T3 (~250 LOC). Note: probably should land after MV-5 (#494) since both share the per-object placement infrastructure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreCore engine — storage, query planner, plugin registryenhancementNew feature or requestp2Nice to havestorageStorage layer (pebble, catalog, keys)

    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