@@ -866,26 +866,11 @@ public void flush(Flush flush) throws EngineException {
866
866
translog .newTransientTranslog (translogId );
867
867
indexWriter .setCommitData (MapBuilder .<String , String >newMapBuilder ().put (Translog .TRANSLOG_ID_KEY , Long .toString (translogId )).map ());
868
868
indexWriter .commit ();
869
- if (flush .force ()) {
870
- // if we force, we might not have committed, we need to check that its the same id
871
- Map <String , String > commitUserData = Lucene .readSegmentInfos (store .directory ()).getUserData ();
872
- long committedTranslogId = Long .parseLong (commitUserData .get (Translog .TRANSLOG_ID_KEY ));
873
- if (committedTranslogId != translogId ) {
874
- // we did not commit anything, revert to the old translog
875
- translog .revertTransient ();
876
- } else {
877
- makeTransientCurrent = true ;
878
- }
879
- } else {
880
- makeTransientCurrent = true ;
881
- }
882
- if (makeTransientCurrent ) {
883
- refreshVersioningTable (threadPool .estimatedTimeInMillis ());
884
- // we need to move transient to current only after we refresh
885
- // so items added to current will still be around for realtime get
886
- // when tans overrides it
887
- translog .makeTransientCurrent ();
888
- }
869
+ refreshVersioningTable (threadPool .estimatedTimeInMillis ());
870
+ // we need to move transient to current only after we refresh
871
+ // so items added to current will still be around for realtime get
872
+ // when tans overrides it
873
+ translog .makeTransientCurrent ();
889
874
} catch (OutOfMemoryError e ) {
890
875
translog .revertTransient ();
891
876
failEngine (e );
0 commit comments