Skip to content

M5a E2E: CreateTable returns ACTIVE but DescribeTable / GetItem / ListTables silently see no data under --shardRanges-only routing #930

@bootjp

Description

@bootjp

症状

scripts/run-jepsen-m5-local.sh 実行時 (PR #924/#925 マージ後)、dynamodb-append-multi-table-workload が全 worker txn で ResourceNotFoundException: table not found を返す。

再現条件

--shardRanges のみで明示的な ranges を指定し、デフォルト range [<empty>, +inf) がない multi-group cluster:

$BINARY \
  --raftBootstrap \
  --raftGroups   "1=127.0.0.1:50051,2=127.0.0.1:50054" \
  --shardRanges  "<T1_KEY>:<T3_KEY>=1,<T3_KEY>:=2" \
  ...

直接 curl での再現 (workload を経由しない最小ケース)

1. CreateTable jepsen_append_t1 → 200 OK, "TableStatus":"ACTIVE"
2. DescribeTable jepsen_append_t1 → ResourceNotFoundException
3. PutItem → ResourceNotFoundException
4. GetItem → ResourceNotFoundException
5. ListTables → {"TableNames":[]} ← 空配列!

つまり CreateTable は成功 response を返すが、続く全 read で table が見えない。

根本原因の仮説 (未確定)

adapter/dynamodb.go:782-806createTable handler は d.coordinator.Dispatch(req) の戻り値 err が nil なら "ACTIVE" を返す。

makeCreateTableRequest の write set:

  • dynamoTableMetaKey(tableName) = !ddb|meta|table|<base64> → routing key !ddb|route|table|<base64> = T1_KEY → group 1
  • dynamoTableGenerationKey(tableName) = !ddb|meta|gen|<base64> → 同じ routing → group 1

両方とも group 1 に行く single-shard txn。 これが Dispatch 成功 (err=nil) を返している。

しかし、続く loadTableSchema (read path):

  • d.store.GetAt(dynamoTableMetaKey(tableName), ts) で同じ key を読む
  • ShardStore.GetAtgroupForKey → group 1 の store
  • 同じ group なのに ErrKeyNotFound 返却

ListTables も空 → commit が durable に store に反映されていないroute range 外として scan/get が除外している 可能性。

確認済み

  • ListRoutes は正常な 2-group catalog を返す
  • /tmp/elastickv-debug/n1/n1/group-{1,2}/fsm.db 両方のディレクトリは存在
  • ❌ サーバログに CreateTable / dispatch / error trace は一切なし (INFO level の制約か)

推測される影響範囲

  • --shardRanges を非デフォルトで指定する全シナリオ
  • 既存の single-group デフォルト routing (run-jepsen-local.sh の 3-node 構成) は影響なし (デフォルト range [<empty>, +inf) あり)

関連 PR

次のステップ

調査が必要:

  1. CreateTable dispatch 後、実際に group 1 の pebble db に何が書かれたか確認 (pebble の low-level inspector が必要)
  2. ShardStore.ScanAt の挙動が --shardRanges 内のキーのみ返すか (default-range 不在で scan boundaries が壊れる可能性)
  3. もしくは loadTableSchemasnapshotTS 計算が新しい write を見えない TS を返している可能性

実装の方向性:

  • (a) parseShardRanges でデフォルト range を補完して --shardRanges 外の routing を可能にする
  • (b) ShardStore 側で scan の boundary handling を修正
  • (c) CreateTable dispatch の commit ack を待つように adapter を修正

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions