photoncloud-monorepo/flaredb/scripts/verify-sharding.sh
centra 8f94aee1fa Fix R8: Convert submodule gitlinks to regular directories
- Remove gitlinks (160000 mode) for chainfire, flaredb, iam
- Add workspace contents as regular tracked files
- Update flake.nix to use simple paths instead of builtins.fetchGit

This resolves the nix build failure where submodule directories
appeared empty in the nix store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:51:20 +09:00

40 lines
1,001 B
Bash
Executable file

#!/usr/bin/env bash
set -e
echo "Building workspace..."
cargo build
echo "Starting PD..."
cargo run --bin rdb-pd &
PD_PID=$!
sleep 2
echo "Starting Server 1 (127.0.0.1:50001, data1)..."
# Port 50001
cargo run --bin rdb-server -- --addr 127.0.0.1:50001 --data-dir data1 --pd-addr 127.0.0.1:2379 &
S1_PID=$!
echo "Starting Server 2 (127.0.0.1:50002, data2)..."
# Port 50002
cargo run --bin rdb-server -- --addr 127.0.0.1:50002 --data-dir data2 --pd-addr 127.0.0.1:2379 &
S2_PID=$!
sleep 5 # Wait for registration
echo "Running Client Verification (Sharding)..."
# Put 'a' (Should go to S1)
echo "Testing Put 'a'..."
cargo run --bin rdb-client -- --addr 127.0.0.1:50001 --pd-addr 127.0.0.1:2379 raw-put --key a --value val_a
# Put 'z' (Should go to S2)
echo "Testing Put 'z'..."
cargo run --bin rdb-client -- --addr 127.0.0.1:50001 --pd-addr 127.0.0.1:2379 raw-put --key z --value val_z
# Cleanup
kill $PD_PID
kill $S1_PID
kill $S2_PID
rm -rf data1 data2
echo "Sharding Verification Complete!"