Merge pull request #4161 from sfc-gh-satherton/fix-redwood-stack-overflow
Fix stack overflow in Redwood
This commit is contained in:
commit
bac5b0404d
|
@ -1837,6 +1837,7 @@ public:
|
|||
state Version minStopVersion = cutoff.version - (BUGGIFY ? deterministicRandom()->randomInt(0, 10) : (self->remapCleanupWindow * SERVER_KNOBS->REDWOOD_REMAP_CLEANUP_LAG));
|
||||
self->remapDestinationsSimOnly.clear();
|
||||
|
||||
state int sinceYield = 0;
|
||||
loop {
|
||||
state Optional<RemappedPage> p = wait(self->remapQueue.pop(cutoff));
|
||||
debug_printf("DWALPager(%s) remapCleanup popped %s\n", self->filename.c_str(), ::toString(p).c_str());
|
||||
|
@ -1855,6 +1856,11 @@ public:
|
|||
if (self->remapCleanupStop && p.get().version >= minStopVersion) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(++sinceYield >= 100) {
|
||||
sinceYield = 0;
|
||||
wait(yield());
|
||||
}
|
||||
}
|
||||
|
||||
debug_printf("DWALPager(%s) remapCleanup stopped (stop=%d)\n", self->filename.c_str(), self->remapCleanupStop);
|
||||
|
|
Loading…
Reference in New Issue