2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-14 01:29:23 +00:00

Make client adaptive to receive global data

When following, let the leader filter the
relevant global data rather than the follower.
This commit is contained in:
Jarrod Johnson 2021-10-19 10:01:44 -04:00
parent fd8dd03587
commit 3cd78500ce

View File

@ -127,10 +127,7 @@ def connect_to_leader(cert=None, name=None, leader=None, remote=None):
log.log({'info': 'Following leader {0}'.format(leader),
'subsystem': 'collective'})
colldata = tlvdata.recv(remote)
# the protocol transmits global data, but for now we ignore it
globaldata = tlvdata.recv(remote)
if 'confluent_uuid' in globaldata:
cfm.set_global('confluent_uuid', globaldata['confluent_uuid'])
dbi = tlvdata.recv(remote)
dbsize = dbi['dbsize']
dbjson = b''
@ -150,8 +147,8 @@ def connect_to_leader(cert=None, name=None, leader=None, remote=None):
cfm._true_add_collective_member(c, colldata[c]['address'],
colldata[c]['fingerprint'],
sync=False)
#for globvar in globaldata:
# cfm.set_global(globvar, globaldata[globvar], False)
for globvar in globaldata:
cfm.set_global(globvar, globaldata[globvar], False)
cfm._txcount = dbi.get('txcount', 0)
cfm.ConfigManager(tenant=None)._load_from_json(dbjson,
sync=False)