severalnines / galera-docker-mariadb

96 stars 88 forks source link

The earliest node to report if there is no higher seqno is computed wrongly. #6

Closed cristic83 closed 6 years ago

cristic83 commented 6 years ago

The computation of the node to report if there is no higher seqno is wrong as it orders the nodes based on the modifiedIndex only without taking into consideration the highest seqNo. The proposed fix is to compute it as below:

node_to_bootstrap=$(cat /tmp/out | jq -c '.node.nodes[].nodes[]?' | grep seqno | tr ',:\"' ' ' | sort -k5,5r -k11 | head -1 | awk -F'/' '{print $(NF-1)}')

ashraf-s9s commented 6 years ago

Hi @cristic83

Thanks for the proposed fix. Code is committed into entrypoint.sh. I'm closing this issue.