Skip to content

Commit

Permalink
Replace calls to nodetool repair directly from database nodemgr with
Browse files Browse the repository at this point in the history
contrail-cassandra-repair since it handles preventing multiple instances
of nodetool repair per keyspace running concurrently.
Closes-Bug: #1513658

Change-Id: I63c4a4123489eea2bf0597f8cc2c7dbc1ec4cb58
(cherry picked from commit 38c8f77)
  • Loading branch information
Megh Bhatt committed Feb 16, 2016
1 parent 2cbe98a commit 7af84d7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/nodemgr/database_event_manager.py
Expand Up @@ -27,8 +27,7 @@
from pysandesh.gen_py.sandesh_trace.ttypes import SandeshTraceRequest
from sandesh_common.vns.ttypes import Module, NodeType
from sandesh_common.vns.constants import ModuleNames, NodeTypeNames,\
Module2NodeType, INSTANCE_ID_DEFAULT, SERVICE_CONTRAIL_DATABASE, \
RepairNeededKeyspaces
Module2NodeType, INSTANCE_ID_DEFAULT, SERVICE_CONTRAIL_DATABASE
from subprocess import Popen, PIPE
from StringIO import StringIO

Expand Down Expand Up @@ -203,11 +202,9 @@ def database_periodic(self):
# 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 7af84d7

Please sign in to comment.