It's possible for scatter_nudge on a scatterlock in LOCK with dirty set to
go to MIX immediately and remain stable. Give two 'nudge' passes before
we stop to avoid looping.
This fixes an assert failure where a nudge from log trimming ended up in a
stable state and asserted (!c). The second pass will go trigger the dirty
writebehind.
Signed-off-by: Sage Weil <sage@newdream.net>
}
if (p->is_auth()) {
+ int count = 0;
while (true) {
if (lock->is_stable()) {
// can we do it now?
default:
assert(0);
}
- if (lock->is_stable()) {
- dout(10) << "scatter_nudge oh, stable again already." << dendl;
+ ++count;
+ if (lock->is_stable() && count == 2) {
+ dout(10) << "scatter_nudge oh, stable after two cycles." << dendl;
// this should only realy happen when called via
// handle_file_lock due to AC_NUDGE, because the rest of the
// time we are replicated or have dirty data and won't get