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

storage: use FIFO order in queues on equal priorities #32053

Merged
merged 2 commits into from
Oct 31, 2018

Conversation

tbg
Copy link
Member

@tbg tbg commented Oct 31, 2018

When priorities are equal, the priority queue naively performs close to
LIFO which is not what we want as it allows starvation of items backed into
the queue. This poses a big problem for the Raft snapshot queue when put
under pressure.

See
#31947 (comment).

Release note (bug fix): Avoid a stall in the processing of Raft snapshots
when many snapshots are requested at the same time.

This is a refactor without functional changes, in preparation for adding
a sequence number generator into the priority queue.

Release note: None
When priorities are equal, the priority queue naively performs close to
LIFO which is not what we want as it allows starvation of items backed
into the queue. This poses a big problem for the Raft snapshot queue
when put under pressure.

See
cockroachdb#31947 (comment).

Release note (bug fix): Avoid a stall in the processing of Raft
snapshots when many snapshots are requested at the same time.
@tbg tbg requested a review from a team October 31, 2018 10:22
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg tbg requested a review from petermattis October 31, 2018 10:22
Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

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

:lgtm:

Looks exactly like what I was imagining.

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@tbg
Copy link
Member Author

tbg commented Oct 31, 2018

bors r=petermattis
TFTR! Unfortunately badness prevails. It looks like we're generating ranges that need snapshots much faster than the queue can process them, FIFO or not.

craig bot pushed a commit that referenced this pull request Oct 31, 2018
32053: storage: use FIFO order in queues on equal priorities r=petermattis a=tschottdorf

When priorities are equal, the priority queue naively performs close to
LIFO which is not what we want as it allows starvation of items backed into
the queue. This poses a big problem for the Raft snapshot queue when put
under pressure.

See
#31947 (comment).

Release note (bug fix): Avoid a stall in the processing of Raft snapshots
when many snapshots are requested at the same time.

Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
@petermattis
Copy link
Collaborator

It looks like we're generating ranges that need snapshots much faster than the queue can process them, FIFO or not.

We need to get to the bottom of what is causing the snapshot generation.

@craig
Copy link
Contributor

craig bot commented Oct 31, 2018

Build succeeded

@craig craig bot merged commit 6240383 into cockroachdb:master Oct 31, 2018
@petermattis
Copy link
Collaborator

We need to get to the bottom of what is causing the snapshot generation.

Which I'm sure you're already doing.

@tbg tbg deleted the fix/queue-fifo branch October 31, 2018 13:37
@tbg
Copy link
Member Author

tbg commented Oct 31, 2018

One failed run at a time.

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