Skip to content

Commit ed82233

Browse files
authored
fix(scripts): M5a — --host 127.0.0.1 for --local mode (#926)
**Bug fix** discovered during the M5a E2E run of `scripts/run-jepsen-m5-local.sh` after PR #924 + #925 merge. ## 症状 `./scripts/run-jepsen-m5-local.sh` 実行時、最初の workload setup! が以下で失敗: ``` DynamoDB :cognitect.anomalies/not-found: n5: nodename nor servname provided, or not known ``` ## 根本原因 `dynamodb_multi_table_workload.clj` の `open!` で: ```clojure host (or (:dynamo-host test) (name node)) ``` `--local` 設定時、`:dynamo-host` は nil なので `(name node)` (`default-nodes` の `"n1".."n5"`) を hostname として使用 → DNS 解決失敗。 ## Fix `lein run` に `--host 127.0.0.1` を追加。`cli/common-cli-opts` 経由で `:host` → `:dynamo-host` → `make-ddb-client` に thread されて、全 5 nodes の client が同じループバック endpoint を dial する。 ## 関連する未解決問題 (本 PR スコープ外) この修正後、setup! は `n5` DNS failure を回避できるが、新たに workers が全 txn で `ResourceNotFoundException: table not found` を返す問題が surface した。: - `create-all-tables!` は (5 並列 client で) 5 回成功 report - ListRoutes は期待通りの 2 group catalog を返す - 直接 curl で `CreateTable` を投げると HTTP 200 + `"TableStatus":"ACTIVE"` - それでも `GetItem` / `TransactGetItems` は `ResourceNotFoundException` 5 client 並列での CreateTable race か、`adapter/dynamodb.go` の internal sync 問題か。別 issue で調査予定。 ## Test plan - [x] `bash -n scripts/run-jepsen-m5-local.sh` 構文OK - [x] 実行時 `n5: nodename nor servname provided` エラーは出ない - [ ] E2E zero G1c — 上記 `ResourceNotFoundException` 別件解決後
2 parents ca0b4e9 + e3f09f2 commit ed82233

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

scripts/run-jepsen-m5-local.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,19 @@ for bin in "$ROUTE_KEY_BIN" "$LIST_ROUTES_BIN" "$BINARY"; do
9696
exit 1
9797
fi
9898
done
99-
T1_KEY="$("$ROUTE_KEY_BIN" jepsen_append_t1)"
10099
T3_KEY="$("$ROUTE_KEY_BIN" jepsen_append_t3)"
101-
# Group 1: [T1_KEY, T3_KEY) — tables 1, 2
102-
# Group 2: [T3_KEY, +inf) — tables 3, 4
103-
# Keys outside [T1_KEY, +inf) fall through to the default group; this
104-
# workload only writes table-route keys so that range is unused.
105-
SHARD_RANGES="${T1_KEY}:${T3_KEY}=1,${T3_KEY}:=2"
100+
# Issue #930 fix: --shardRanges must cover every routing key. Without
101+
# a [<empty>, T1_KEY) range, any table whose base64-encoded name sorts
102+
# before "amVwc2VuX2FwcGVuZF90MQ" (= base64("jepsen_append_t1"))
103+
# returns "no route for key" from ShardedCoordinator.dispatchTxn, and
104+
# createTableWithRetry silently swallows that as ACTIVE.
105+
#
106+
# Group 1: [<empty>, T3_KEY) — default + tables 1, 2
107+
# Group 2: [T3_KEY, +inf) — tables 3, 4
108+
#
109+
# Note: assigning the default range to group 1 (not a third group) keeps
110+
# the topology consistent with the 1-process-2-groups launch.
111+
SHARD_RANGES=":${T3_KEY}=1,${T3_KEY}:=2"
106112
echo "[shard-ranges] $SHARD_RANGES"
107113

108114
# ---- stop any previously managed cluster ----
@@ -200,12 +206,22 @@ mkdir -p tmp-home .lein
200206
# (verify-multi-group-routing!) at the workload's first setup! call.
201207
# Without them the hook falls back to PATH lookup which fails when
202208
# run from this script's tmp build.
209+
#
210+
# --host 127.0.0.1 — without this the workload's open! resolves the
211+
# DynamoDB client hostname from (name node) where node is one of
212+
# default-nodes ["n1" "n2" "n3" "n4" "n5"]; these are virtual labels,
213+
# not real hostnames, and DNS resolution fails with 'nodename nor
214+
# servname provided'. --host overrides via cli/common-cli-opts'
215+
# --host -> :host -> :dynamo-host -> make-ddb-client wiring. Required
216+
# for the single-process two-group topology this script launches —
217+
# every "node" client talks to the same loopback DynamoDB endpoint.
203218
HOME="$(pwd)/tmp-home" LEIN_HOME="$(pwd)/.lein" \
204219
LEIN_JVM_OPTS="-Duser.home=$(pwd)/tmp-home" \
205220
"$LEIN_BIN" run -m elastickv.dynamodb-multi-table-workload \
206221
--local \
207222
--time-limit 30 \
208223
--rate 5 \
224+
--host 127.0.0.1 \
209225
--dynamo-port 63801 \
210226
--list-routes-bin "$LIST_ROUTES_BIN" \
211227
--grpc-host-port "$PROC_ADDR" \

0 commit comments

Comments
 (0)