Skip to content

Commit

Permalink
Merge pull request #6227 from drmingdrmer/3-rm-get
Browse files Browse the repository at this point in the history
[metasrv] fix: add step instruction to tests/metactl/test-metactl;
  • Loading branch information
mergify[bot] authored Jun 25, 2022
2 parents bd8bfd4 + bd2b2c3 commit e7bb1a2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/metactl/test-metactl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,39 @@ grpc_exported="$SCRIPT_PATH/exported"

chmod +x ./target/${BUILD_PROFILE}/databend-metactl


echo " === import into $meta_dir"
cat $meta_json |
./target/${BUILD_PROFILE}/databend-metactl --import --raft-dir "$meta_dir"

sleep 1


echo " === export from $meta_dir"
./target/${BUILD_PROFILE}/databend-metactl --export --raft-dir "$meta_dir" >$exported


echo " === check backup date $meta_json and exported $exported"
diff $meta_json $exported


echo " === start a single node databend-meta"
# test export from grpc
chmod +x ./target/${BUILD_PROFILE}/databend-meta
./target/${BUILD_PROFILE}/databend-meta --single &
METASRV_PID=$!
echo $METASRV_PID
sleep 0.5
sleep 1


echo " === export data from a running databend-meta to $grpc_exported"
./target/${BUILD_PROFILE}/databend-metactl --export --grpc-api-address "127.0.0.1:9191" >$grpc_exported

echo " === exported file data start..."
cat $grpc_exported
echo " === exported file data end"

echo " === check if there is a node record in it"
grep -Fxq '["raft_state",{"RaftStateKV":{"key":"Id","value":{"NodeId":0}}}]' $grpc_exported

kill $METASRV_PID

0 comments on commit e7bb1a2

Please sign in to comment.