private void maybeFSyncTranslogs() {
   if (indexSettings.getTranslogDurability() == Translog.Durability.ASYNC) {
     for (IndexShard shard : this.shards.values()) {
       try {
         Translog translog = shard.getTranslog();
         if (translog.syncNeeded()) {
           translog.sync();
         }
       } catch (EngineClosedException | AlreadyClosedException ex) {
         // fine - continue;
       } catch (IOException e) {
         logger.warn("failed to sync translog", e);
       }
     }
   }
 }