From 8e9bcbb44f17a4880c6ac58716cb21f837ff913b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 Jul 2018 09:40:22 -0400 Subject: [PATCH] Clear txcount on enroll The transaction count on 'join' was being honored as high, when it never should be. --- confluent_server/confluent/collective/manager.py | 1 + confluent_server/confluent/config/configmanager.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/confluent_server/confluent/collective/manager.py b/confluent_server/confluent/collective/manager.py index 50e07fe5..609b6458 100644 --- a/confluent_server/confluent/collective/manager.py +++ b/confluent_server/confluent/collective/manager.py @@ -227,6 +227,7 @@ def handle_connection(connection, cert, request, local=False): f = open('/etc/confluent/cfg/myname', 'w') f.write(name) f.close() + cfm.clear_configuration() eventlet.spawn_n(connect_to_leader, rsp['collective']['fingerprint'], name) if 'enroll' == operation: #TODO(jjohnson2): error appropriately when asked to enroll, but the master is elsewhere diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 3d148ecb..76f7b99c 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -497,8 +497,10 @@ def stop_leading(): def clear_configuration(): global _cfgstore + global _txcount _cfgstore = {} todelete = _config_areas + ('globals', 'collective', 'transactioncount') + _txcount = 0 for cfg in todelete: try: os.remove(os.path.join(ConfigManager._cfgdir, cfg))