Skip to content
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

multiple instances support for grpc broker. #235

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

morvencao
Copy link
Contributor

@morvencao morvencao commented Dec 18, 2024

@clyang82
Copy link
Contributor

/ok-to-test

@morvencao
Copy link
Contributor Author

morvencao commented Dec 18, 2024

/hold

depends on #232

@morvencao morvencao force-pushed the br_grpc_ha branch 5 times, most recently from 1ce55ab to 580601f Compare December 18, 2024 11:07
// check if all instances have processed the event
if !compareStrings(activeInstances, eventInstances) {
klog.V(10).Infof("Event %s is not processed by all instances, handled by %v, active instances %v", event.ID, eventInstances, activeInstances)
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need requeue here (return an error)? or there are some processes can retrigger this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, reconcileDate is not set, the 'SyncEvent' will trigger event be processed again?

If we return an error here, the current instance will process the event again, but the event may not be handled by other instances. so return an error doesn't help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking maybeactiveInstances is_subset_of eventInstances make more sense?

Copy link
Contributor

@skeeey skeeey Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we return an error here, the current instance will process the event again, but the event may not be handled by other instances. so return an error doesn't help.

so this means the ReconciledDate will be marked finally by the the "last" instance, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I added some comments to explain different cases.

if svcErr != nil {
// if the resource is not found, it indicates the resource has been handled by
// other instances, so we can mark the event as reconciled and ignore it.
if svcErr.Is404() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a log here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants