-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host: only evict HA sequencer enclaves #2222
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,15 @@ func (e *Service) GetEnclaveClients() []common.Enclave { | |
return clients | ||
} | ||
|
||
func (e *Service) EvictEnclave(enclaveID *common.EnclaveID) { | ||
func (e *Service) NotifyUnavailable(enclaveID *common.EnclaveID) { | ||
if len(e.enclaveGuardians) <= 1 { | ||
e.logger.Info("not running in HA mode, no need to evict enclave", log.EnclaveIDKey, enclaveID) | ||
return | ||
} | ||
if *e.activeSequencerID != *enclaveID { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason we can't compare the actual values here instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this does compare the values (although I haven't fully internalised the quirks around this tbh lol). I had it as |
||
e.logger.Info("Enclave is not the active sequencer, no need to evict yet.", log.EnclaveIDKey, enclaveID) | ||
return | ||
} | ||
failedEnclaveIdx := -1 | ||
e.haLock.Lock() | ||
defer e.haLock.Unlock() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to stick this in the host config in the event enclaves are getting stuck for a while (networking issues or something). when we're on K8s will be really easy to tweak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah agree but still a bit finger in the air on all this stuff (like it might end up being that we want to evict based on a timeout or just on failed batch submission). I'll add a todo to be configurable once we're happy with the trigger.