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

rework range level gossiping; remove Range.start() #884

Merged
merged 3 commits into from
May 4, 2015

Conversation

tbg
Copy link
Member

@tbg tbg commented May 1, 2015

  • configs are now initially gossiped on store start,
    but also "heartbeat" periodically by the store for those
    ranges which contain them.
    this is necessary since leader crashes may in some scenarios
    prevent persisted data from being circulated via gossip.
    configs are now also gossiped upon extending (previously
    only on obtaining) a leader lease, and when an update to them is
    written (as before).
  • removed range.start(), which is now obsolete.
    A range is now a single object free of attached goroutines
    or special cases to populate gossip upon instantiation.
  • disabled various tests and added TODOs with instructions
    on how to fix them.

there are some data races because we fill gossip very early (while some of its contents are being printed, I think). will take care of this before merging, but the rest should be ready for a good look.

fixes #872

@tbg tbg added the PTAL label May 1, 2015
}
timestamp := r.rm.Clock().Now()

// Check for or obtain the lease, if none active.
if err := r.redirectOnOrAcquireLeaderLease(timestamp); err != nil {
err := r.redirectOnOrAcquireLeaderLease(timestamp)
if err != nil {
switch e := err.(type) {
// NotLeaderError means there is an active lease, leaseRejectedError
// means we tried to get one but someone beat us to it. They're nothing
Copy link
Member

Choose a reason for hiding this comment

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

s/ They're nothing//

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@spencerkimball
Copy link
Member

LGTM

@tbg tbg added LGTM and removed PTAL labels May 4, 2015
tbg added 3 commits May 4, 2015 10:22
- configs are now initially gossiped on store start,
  but also "heartbeat" periodically by the store for those
  ranges which contain them.
  this is necessary since leader crashes may in some scenarios
  prevent persisted data from being circulated via gossip.
  as before, configs are also gossiped upon obtaining (not
  extending!) a leader lease, and when an update to them is
  written.
- removed range.start(), which is now obsolete.
  A range is now a single object free of attached goroutines
  or special cases to populate gossip upon instantiation.
- disabled various tests and added TODOs with instructions
  on how to fix them.
@tbg tbg force-pushed the store_gossip branch from 5fb1818 to e44aec1 Compare May 4, 2015 14:25
tbg added a commit that referenced this pull request May 4, 2015
rework range level gossiping; remove Range.start()
@tbg tbg merged commit e0131a3 into cockroachdb:master May 4, 2015
@tbg tbg deleted the store_gossip branch May 4, 2015 15:09
@tbg tbg removed the LGTM label May 4, 2015
@spencerkimball
Copy link
Member

LGTM

kkaneda added a commit that referenced this pull request Jun 27, 2015
The code was changed by #884 so that gossip is published even when the
replica is not a new lease holder.
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.

get leader lease and gossip configs and first range information at range start
2 participants