scylladb / scylla-code-samples

Code samples for working with ScyllaDB
Apache License 2.0
243 stars 131 forks source link

scylla-check-gossiper-generation hits false-positive matches #130

Closed dmeetryk closed 3 months ago

dmeetryk commented 4 years ago

Pattern used in the script to select "node-IP-section" (grep -A1 "$IP") allows false positives if searched IP is a sub-string of another node IPs. As result the script fails. E.g. (in our setup):

$ IP=$(hostname -i) && nodetool gossipinfo | grep -A1 "$IP"
/10.3.80.6
  generation:1583954108
#...
--
/10.3.80.69
  generation:1583957204
#...

We did proceed with upgrade after modification, but would it be possible to change it to something like grep -A1 "^/${IP}$"?

BTW, existing PR modifying patterns in this script has the same issue only in awk pattern.

tarzanek commented 2 years ago

@dmeetryk hello, is this still relevant in the scope of merged https://github.com/scylladb/scylla-code-samples/pull/151 ? if not, we can close this