mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-26 10:59:53 +00:00
Error if starting without quorum
If collective mode is present, but no candidates worked, still error out.
This commit is contained in:
parent
5588712320
commit
b315042850
@ -251,6 +251,8 @@ def start_collective():
|
||||
for member in cfm.list_collective():
|
||||
if member == myname:
|
||||
continue
|
||||
if cfm.cfgleader is None:
|
||||
cfm.cfgleader = True
|
||||
ldrcandidate = cfm.get_collective_member(member)['address']
|
||||
connect_to_leader(name=myname, leader=ldrcandidate)
|
||||
|
||||
|
@ -212,6 +212,8 @@ def _rpc_set_group_attributes(tenant, attribmap, autocreate):
|
||||
ConfigManager(tenant)._true_set_group_attributes(attribmap, autocreate)
|
||||
|
||||
def exec_on_leader(function, *args):
|
||||
if isinstance(cfgleader, bool):
|
||||
raise exc.DegradedCollective()
|
||||
xid = os.urandom(8)
|
||||
while xid in _pendingchangesets:
|
||||
xid = os.urandom(8)
|
||||
|
@ -68,6 +68,11 @@ class LockedCredentials(ConfluentException):
|
||||
_apierrorstr = 'Credential store locked'
|
||||
|
||||
|
||||
class DegradedCollective(ConfluentException):
|
||||
# We are in a collective with at least half of the member nodes missing
|
||||
_apierrorstr = 'Collective does not have quorum'
|
||||
|
||||
|
||||
class ForbiddenRequest(ConfluentException):
|
||||
# The client request is not allowed by authorization engine
|
||||
apierrorcode = 403
|
||||
|
Loading…
x
Reference in New Issue
Block a user