aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaksim <maksimlitskevich@gmail.com>2022-04-28 14:04:55 +0300
committermaksim <maksimlitskevich@gmail.com>2022-04-28 14:04:55 +0300
commitd138385c6179120a2d5494788330c7c6ca0321c8 (patch)
tree338cdf986da6cfc7cf01d2ee8d6ff7f6a7bd622e
parent7e91ce2fe8371e7a7c63072be58e99561ed518e1 (diff)
downloadydb-d138385c6179120a2d5494788330c7c6ca0321c8.tar.gz
fix ram-mode associated bugs
-rwxr-xr-xydb/deploy/local_binary/linux/start.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/ydb/deploy/local_binary/linux/start.sh b/ydb/deploy/local_binary/linux/start.sh
index d048c71da0c..2f9534fd824 100755
--- a/ydb/deploy/local_binary/linux/start.sh
+++ b/ydb/deploy/local_binary/linux/start.sh
@@ -3,12 +3,12 @@ if [[ $1 != "disk" && $1 != "ram" ]]; then
echo Please specify 'disk' or 'ram' as the parameter
exit
fi
+need_init=0
if [[ $1 = "disk" ]]; then
- need_init=0
if [ ! -f ydb.data ]; then
- echo Data file ydb.data not found, creating ...
+ echo Data file ydb.data not found, creating ...
fallocate -l 64G ydb.data
- if [[ $? -ge 1 ]]; then
+ if [[ $? -ge 1 ]]; then
if [ -f ydb.data ]; then
rm ydb.data
fi
@@ -28,15 +28,19 @@ sleep 3
grep logs/storage_start_err.log -v -f config/exclude_err.txt
if [[ $? -eq 0 ]]; then
echo Errors found when starting storage process, cancelling start script
+ if [ $need_init -eq 1 ]; then
+ rm ydb.data
+ fi
exit
fi
-
-if [ $need_init -eq 1 ]; then
+if [ $need_init -eq 1 ] || [ $cfg == "ram.yaml" ]; then
echo Initializing storage ...
`pwd`/ydbd/bin/ydbd -s grpc://localhost:2136 admin blobstorage config init --yaml-file config/$cfg > logs/init_storage.log 2>&1
if [[ $? -ge 1 ]]; then
echo Errors found when initializing storage, cancelling start script, check logs/init_storage.log
- rm ydb.data
+ if [ $need_init -eq 1 ]; then
+ rm ydb.data
+ fi
exit
fi
fi