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

server: reduce lock scope for region heartbeat. #677

Merged
merged 3 commits into from
Jul 10, 2017
Merged

Conversation

disksing
Copy link
Contributor

The main purpose is to avoid holding mutex to write kv.

@siddontang
Copy link
Contributor

LGTM

PTAL @huachaohuang

origin := c.regions.getRegion(region.GetId())
c.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

The cache and kv may not be consistent, for example, if a region's leader sends a heartbeat and then elects another leader and sends another heartbeat with a new version. But it seems not a problem, because they will be consistent finally?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, we will guarantee eventual consistency.

Copy link
Contributor

@huachaohuang huachaohuang left a comment

Choose a reason for hiding this comment

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

LGTM

@disksing disksing merged commit 759d28b into master Jul 10, 2017
@disksing disksing deleted the disksing/hb-lock branch July 10, 2017 09:21
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.

None yet

3 participants