-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: add a callback to StorePool for store status updates #12528
storage: add a callback to StorePool for store status updates #12528
Conversation
Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/storage/store_pool.go, line 266 at r1 (raw file):
Are there any locking concerns with invoking the callbacks while holding Comments from Reviewable |
Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/storage/store_pool.go, line 266 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
None with the one usage, but I think it's safer to copy the slice of callbacks and invoke them outside of the mutex lock. Comments from Reviewable |
87886a5
to
3dec4e0
Compare
Reviewed 2 of 3 files at r1, 2 of 2 files at r2. Comments from Reviewable |
though I'm not entirely clear on why we need a new mechanism; this seems exactly equivalent to a narrower gossip callback regex. Reviewed 2 of 3 files at r1, 2 of 2 files at r2. pkg/storage/replicate_queue.go, line 120 at r2 (raw file):
desc -> _ pkg/storage/replicate_queue.go, line 123 at r2 (raw file):
would removing this line, alone (without the rest of this change), produce the same change in behaviour? pkg/storage/store_pool.go, line 155 at r2 (raw file):
nit: consider removing the names which aren't descriptive here pkg/storage/store_pool.go, line 263 at r2 (raw file):
preallocate? pkg/storage/store_pool.go, line 271 at r2 (raw file):
is accessing detail.desc safe to do without the mutex held? seems like the answer is no, and this should be passing Comments from Reviewable |
Review status: all files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. pkg/storage/replicate_queue.go, line 123 at r2 (raw file): Previously, tamird (Tamir Duberstein) wrote…
I had this same thought as I was driving around doing errands this afternoon. Seems that you want to add a callback to Comments from Reviewable |
3dec4e0
to
f178e01
Compare
Good point. It is equivalent. I'm adding a callback to node liveness. Review status: all files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. pkg/storage/replicate_queue.go, line 120 at r2 (raw file): Previously, tamird (Tamir Duberstein) wrote…
N/A pkg/storage/replicate_queue.go, line 123 at r2 (raw file): Previously, petermattis (Peter Mattis) wrote…
Done. pkg/storage/store_pool.go, line 155 at r2 (raw file): Previously, tamird (Tamir Duberstein) wrote…
N/A pkg/storage/store_pool.go, line 263 at r2 (raw file): Previously, tamird (Tamir Duberstein) wrote…
N/A pkg/storage/store_pool.go, line 271 at r2 (raw file): Previously, tamird (Tamir Duberstein) wrote…
N/A Comments from Reviewable |
Review status: 1 of 4 files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. pkg/storage/node_liveness.go, line 477 at r3 (raw file):
Similar comment as before: you're invoking the callback with Comments from Reviewable |
f178e01
to
11ceab9
Compare
Review status: 1 of 4 files reviewed at latest revision, 3 unresolved discussions. pkg/storage/node_liveness.go, line 477 at r3 (raw file): Previously, petermattis (Peter Mattis) wrote…
Done. Comments from Reviewable |
Reviewed 5 of 5 files at r3, 1 of 1 files at r4. pkg/storage/node_liveness.go, line 475 at r3 (raw file):
Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. pkg/storage/node_liveness.go, line 475 at r3 (raw file): Previously, tamird (Tamir Duberstein) wrote…
Why? This would be moderately terser (and clearer) without the variables, though:
Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. pkg/storage/node_liveness.go, line 475 at r3 (raw file): Previously, petermattis (Peter Mattis) wrote…
That was just leftover stuff from a previous iteration which invoked the callback on change from live to not-live and vice versa. Removed. Comments from Reviewable |
11ceab9
to
0806084
Compare
Reviewed 1 of 1 files at r5. Comments from Reviewable |
This is used to prevent busy purgatory checks for the replicate queue on every node liveness heartbeat. However, we still do the check on the periodic node status updates, which happen once a minute by default. Fixes #12298
0806084
to
47a4612
Compare
This prevents busy purgatory checks for the replicate queue on every
node liveness heartbeat. However, we still do the check on the
periodic node status updates, which happen once a minute by default.
Fixes #12298
This change is