throw e;
}
// We have "stickiness" so that sometimes all we do is vary the RAM buffer size, other times just the doc count to flush by, else both.
// This way the assertMemory in DocumentsWriterFlushControl sometimes runs (when we always flush by RAM).
LiveIWCFlushMode flushMode;
switch (random().nextInt(3)) {
case 0:
flushMode = LiveIWCFlushMode.BY_RAM;
break;
case 1: