Skip to content

Commit

Permalink
ansible: fix calc max chunk id error when recycle copysets
Browse files Browse the repository at this point in the history
  • Loading branch information
Wine93 authored and xu-chaojie committed Apr 30, 2021
1 parent c75f32b commit aa0e97b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions curve-ansible/roles/clean/files/recycle_chunks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function chunkfilepoolinfo() {
fi

# chunkfilepool
maxChunkId=`ls -vr $chunkfilepool | head -1`
maxChunkId=`ls $chunkfilepool | grep -oE '^([0-9]+)' | sort -rh | head -n 1`
leftChunkNum=`ls $chunkfilepool | wc -l`

# chunknum to be recycled
Expand Down Expand Up @@ -77,7 +77,8 @@ function recycle_copysets() {
rsegmentSum=0

# recycle chunks
maxChunkId=`ls -vr $chunkfilepool | head -1`
maxChunkId=`ls $chunkfilepool | grep -oE '^([0-9]+)' | sort -rh | head -n 1`

for copyset in `ls $2`
do
copysetPath=${dataDir}/chunkserver$1/copysets/${copyset}
Expand Down Expand Up @@ -112,7 +113,7 @@ function recycle_copysets() {

# recycle chunks in raft_snapshot
rchunkSum=0
maxChunkId=`ls -vr $chunkfilepool | head -1`
maxChunkId=`ls $chunkfilepool | grep -oE '^([0-9]+)' | sort -rh | head -n 1`
for copyset in `ls $2`
do
copysetPath=${dataDir}/chunkserver$1/copysets/${copyset}
Expand Down Expand Up @@ -194,4 +195,4 @@ main() {
wait
}

main $@
main $@

0 comments on commit aa0e97b

Please sign in to comment.