Skip to content

Commit

Permalink
Call contrail-cassandra-status periodically every minute from
Browse files Browse the repository at this point in the history
database nodemgr to record and update cassandra status. Replace
calls to nodetool repair directly from database nodemgr with
contrail-cassandra-repair.
Partial-Bug: #1484297

Change-Id: I471817e5fa7a5280c771198a3fdfe4797dc8dca5
  • Loading branch information
Megh Bhatt committed Aug 31, 2015
1 parent 508c70d commit addd9fb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/nodemgr/database_event_manager.py
Expand Up @@ -199,15 +199,16 @@ def database_periodic(self):
else:
self.fail_status_bits &= ~self.FAIL_STATUS_SERVER_PORT
self.send_nodemgr_process_status()

# Record cluster status and shut down cassandra if needed
subprocess.Popen(["contrail-cassandra-status",
"--log-file", "/var/log/cassandra/status.log",
"--debug"])
# end database_periodic

def cassandra_repair(self):
for keyspace in RepairNeededKeyspaces:
repair_file_name = '/var/log/cassandra/repair-' + keyspace + '.log'
with open(repair_file_name, "a") as repair_file:
subprocess.Popen(["nodetool", "repair", "-pr", keyspace],
stdout=repair_file, stderr=repair_file)
subprocess.Popen(["contrail-cassandra-repair",
"--log-file", "/var/log/cassandra/repair.log",
"--debug"])
#end cassandra_repair

def send_disk_usage_info(self):
Expand Down

0 comments on commit addd9fb

Please sign in to comment.