Skip to content

Fixed NPE and cache invalidation in leader election - #9460

Merged
merlimat merged 2 commits into
apache:masterfrom
merlimat:fix-leader-election-flaky
Feb 4, 2021
Merged

merlimat merged 2 commits into
apache:masterfrom
merlimat:fix-leader-election-flaky

Conversation

@merlimat

@merlimat merlimat commented Feb 3, 2021

Copy link
Copy Markdown
Contributor

Motivation

Since we're relying on the watch to invalidate the cache, if another broker becomes leader we're trying in a loop to read and write based on an outdated version of metadata, until the watch arrives. Instead, since we already know that the cache is out of sync, we should proactively invalidate it.

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Feb 3, 2021
@merlimat merlimat added this to the 2.8.0 milestone Feb 3, 2021
@merlimat merlimat self-assigned this Feb 3, 2021
@lhotari

lhotari commented Feb 4, 2021

Copy link
Copy Markdown
Member

/pulsarbot run-failure-checks

@lhotari

lhotari commented Feb 4, 2021

Copy link
Copy Markdown
Member

/pulsarbot run-failure-checks

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@merlimat
merlimat merged commit cdef644 into apache:master Feb 4, 2021
@merlimat
merlimat deleted the fix-leader-election-flaky branch February 4, 2021 23:18
merlimat added a commit to merlimat/pulsar that referenced this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants