Skip to content

Commit

Permalink
Merge "Kafka config should be re-written on upgrade, in-case Kafka is…
Browse files Browse the repository at this point in the history
… being upgraded We have ensured that repeating this operation is safe" into R3.0
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 22, 2016
2 parents 36bbf58 + 54573d3 commit 59ac45e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions contrail_provisioning/database/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ def fixup_kafka_server_properties(self, listen_ip):

# Set log compaction and topic delete options
self.replace_in_file(KAFKA_SERVER_PROPERTIES, 'log.cleaner.enable=false','log.cleaner.enable=true')
local('sudo echo "log.cleanup.policy=compact" >> %s' % KAFKA_SERVER_PROPERTIES)
local('sudo echo "delete.topic.enable=true" >> %s' % KAFKA_SERVER_PROPERTIES)
if not self.file_pattern_check(KAFKA_SERVER_PROPERTIES, 'log.cleanup.policy=compact'):
local('sudo echo "log.cleanup.policy=compact" >> %s' % KAFKA_SERVER_PROPERTIES)
if not self.file_pattern_check(KAFKA_SERVER_PROPERTIES, 'delete.topic.enable=true'):
local('sudo echo "delete.topic.enable=true" >> %s' % KAFKA_SERVER_PROPERTIES)

#Set replication factor to 2 if more than one kafka broker is available
if (len(zk_list)>1):
Expand Down
6 changes: 2 additions & 4 deletions contrail_provisioning/database/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ def upgrade(self):
self.fixup_cassandra_upgrade()

self._upgrade()
# Kafka is must from release 3.00
if (self._args.from_rel < LooseVersion('3.00') and
self._args.to_rel >= LooseVersion('3.00')):
self.fixup_kafka_server_properties(self._args.self_ip)
# Accomodate Kafka upgrade, if needed
self.fixup_kafka_server_properties(self._args.self_ip)
# Adding hostip in contrail-database-nodemgr.conf
if (self._args.from_rel < LooseVersion('2.20') and
self._args.to_rel >= LooseVersion('2.20')):
Expand Down

0 comments on commit 59ac45e

Please sign in to comment.