@@ -206,7 +206,7 @@ public void testAppendEntries() throws Exception {
206206 SimpleOperation op = new SimpleOperation ("m" + i );
207207 LogEntryProto entry = LogProtoUtils .toLogEntryProto (op .getLogEntryContent (), term , i ++ + start );
208208 size += getEntrySize (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE );
209- segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE );
209+ segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE , true );
210210 }
211211
212212 Assertions .assertTrue (segment .getTotalFileSize () >= max );
@@ -238,18 +238,18 @@ public void testAppendWithGap() throws Exception {
238238 final StateMachineLogEntryProto m = op .getLogEntryContent ();
239239 try {
240240 LogEntryProto entry = LogProtoUtils .toLogEntryProto (m , 0 , 1001 );
241- segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE );
241+ segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE , true );
242242 Assertions .fail ("should fail since the entry's index needs to be 1000" );
243243 } catch (IllegalStateException e ) {
244244 // the exception is expected.
245245 }
246246
247247 LogEntryProto entry = LogProtoUtils .toLogEntryProto (m , 0 , 1000 );
248- segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE );
248+ segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE , true );
249249
250250 try {
251251 entry = LogProtoUtils .toLogEntryProto (m , 0 , 1002 );
252- segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE );
252+ segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE , true );
253253 Assertions .fail ("should fail since the entry's index needs to be 1001" );
254254 } catch (IllegalStateException e ) {
255255 // the exception is expected.
@@ -264,7 +264,7 @@ public void testTruncate() throws Exception {
264264 for (int i = 0 ; i < 100 ; i ++) {
265265 LogEntryProto entry = LogProtoUtils .toLogEntryProto (
266266 new SimpleOperation ("m" + i ).getLogEntryContent (), term , i + start );
267- segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE );
267+ segment .appendToOpenSegment (entry , LogSegment .Op .WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE , true );
268268 }
269269
270270 // truncate an open segment (remove 1080~1099)
0 commit comments