|
@@ -1641,6 +1641,9 @@ public class Translog extends AbstractIndexShardComponent implements IndexShardC
|
|
|
* @throws IOException if an I/O exception occurred during any file operations
|
|
* @throws IOException if an I/O exception occurred during any file operations
|
|
|
*/
|
|
*/
|
|
|
public void rollGeneration() throws IOException {
|
|
public void rollGeneration() throws IOException {
|
|
|
|
|
+ // make sure we move most of the data to disk outside of the writeLock
|
|
|
|
|
+ // in order to reduce the time the lock is held since it's blocking all threads
|
|
|
|
|
+ sync();
|
|
|
try (Releasable ignored = writeLock.acquire()) {
|
|
try (Releasable ignored = writeLock.acquire()) {
|
|
|
try {
|
|
try {
|
|
|
final TranslogReader reader = current.closeIntoReader();
|
|
final TranslogReader reader = current.closeIntoReader();
|