BrianGallew / cassandra_range_repair

python script to repair the primary range of a node in N discrete steps
MIT License
109 stars 47 forks source link

datacenter search_value not 2.1 compatible #27

Closed Mortinke closed 8 years ago

Mortinke commented 9 years ago
# This is a really well-specified value.  If the format of the
# output of 'nodetool gossipinfo' changes, this will have to be
# revisited.

The time has come, the output is changed in Version 2.1 ;)

Cassandra added numbers to the gossipinfo output, so that the search value no longer works:

cassandra 2.0.x output

/<ip_address_node_x>
  generation:1447001651
  heartbeat:1474563
  HOST_ID:7728d6dc-81f5-4b65-8f6f-56154a699aa9
  STATUS:NORMAL,-1256802229644094855
  SEVERITY:6.938893903907228E-18
  NET_VERSION:6
  LOAD:4.42385489232E11
  DC:datacenter1
  SCHEMA:5b0d09a2-5a55-3307-9349-c9c6a7af4581
  RACK:rack1
  RPC_ADDRESS:<ip_address_node_x>
  RELEASE_VERSION:1.2.19
/<ip_address_node_x>
  generation:1448029831
  heartbeat:427997
  HOST_ID:5d11e4e6-219e-4a22-8c6b-245a5cbd6d3a
  STATUS:NORMAL,6214099238388467859
  SEVERITY:0.0
  NET_VERSION:6
  LOAD:3.2200086618E11
  DC:datacenter1
  SCHEMA:5b0d09a2-5a55-3307-9349-c9c6a7af4581
  RACK:rack1
  RPC_ADDRESS:<ip_address_node_x>
  RELEASE_VERSION:1.2.19

cassandra 2.1.x output

/<ip_address_node_x>
  generation:1445591070
  heartbeat:8677350
  NET_VERSION:1:8
  HOST_ID:2:3bd77948-2dad-45d2-9a39-46fca7498641
  STATUS:14:NORMAL,-107043648109545801
  RPC_ADDRESS:3:<ip_address_node_x>
  SEVERITY:8677352:0.0
  SCHEMA:8316519:ab586e11-897e-30ff-8732-391b15786f79
  LOAD:8677214:2.9703713869E10
  RELEASE_VERSION:4:2.1.10
  DC:6:datacenter1
  RACK:8:rack1
  TOKENS:13:<hidden>
/<ip_address_node_x>
  generation:1445591100
  heartbeat:8677298
  NET_VERSION:1:8
  HOST_ID:2:72f794c7-6066-4117-888c-92e91c779dfb
  STATUS:14:NORMAL,-1002667987248120783
  RPC_ADDRESS:3:<ip_address_node_x>
  SEVERITY:8677297:0.0
  SCHEMA:8316467:ab586e11-897e-30ff-8732-391b15786f79
  LOAD:8677249:2.7910465723E10
  RELEASE_VERSION:4:2.1.10
  DC:6:datacenter1
  RACK:8:rack1
  TOKENS:13:<hidden>

We use only cassandra version 2.1.x, so that I changed the search_value to

search_value = "\n  DC:6:{datacenter}\n".format(datacenter=self.options.datacenter)

I'm not a good pearl developer, so I hope that anyone could create a better solution with a version und search_value handling.

elsmorian commented 8 years ago

The same problem happens again in Cassandra version 2.2 - DC:6: has changed to DC:8: - Have added a PR to use a regex instead that should support 2.0, 2.1 and 2.2

JensRantil commented 8 years ago

Since #29 is merged, maybe this can be closed now?