|
40 | 40 | import org.elasticsearch.cluster.routing.UnassignedInfo; |
41 | 41 | import org.elasticsearch.cluster.service.ClusterService; |
42 | 42 | import org.elasticsearch.common.CheckedRunnable; |
| 43 | +import org.elasticsearch.common.Strings; |
43 | 44 | import org.elasticsearch.common.UUIDs; |
44 | 45 | import org.elasticsearch.common.breaker.CircuitBreaker; |
45 | 46 | import org.elasticsearch.common.bytes.BytesArray; |
|
57 | 58 | import org.elasticsearch.index.IndexService; |
58 | 59 | import org.elasticsearch.index.IndexSettings; |
59 | 60 | import org.elasticsearch.index.VersionType; |
| 61 | +import org.elasticsearch.index.engine.CommitStats; |
60 | 62 | import org.elasticsearch.index.engine.Engine; |
61 | 63 | import org.elasticsearch.index.engine.SegmentsStats; |
62 | 64 | import org.elasticsearch.index.flush.FlushStats; |
63 | 65 | import org.elasticsearch.index.mapper.SourceToParse; |
64 | 66 | import org.elasticsearch.index.seqno.SequenceNumbers; |
65 | 67 | import org.elasticsearch.index.translog.Translog; |
| 68 | +import org.elasticsearch.index.translog.TranslogStats; |
66 | 69 | import org.elasticsearch.indices.IndicesService; |
67 | 70 | import org.elasticsearch.indices.breaker.CircuitBreakerService; |
68 | 71 | import org.elasticsearch.indices.breaker.CircuitBreakerStats; |
@@ -337,7 +340,6 @@ public void testIndexCanChangeCustomDataPath() throws Exception { |
337 | 340 | assertPathHasBeenCleared(endDir.toAbsolutePath()); |
338 | 341 | } |
339 | 342 |
|
340 | | - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/37896") |
341 | 343 | public void testMaybeFlush() throws Exception { |
342 | 344 | createIndex("test", Settings.builder().put(IndexSettings.INDEX_TRANSLOG_DURABILITY_SETTING.getKey(), Translog.Durability.REQUEST) |
343 | 345 | .build()); |
@@ -376,8 +378,12 @@ public void testMaybeFlush() throws Exception { |
376 | 378 | logger.info("--> translog size after delete: [{}] num_ops [{}] generation [{}]", |
377 | 379 | translog.stats().getUncommittedSizeInBytes(), translog.stats().getUncommittedOperations(), translog.getGeneration()); |
378 | 380 | assertBusy(() -> { // this is async |
379 | | - logger.info("--> translog size on iter : [{}] num_ops [{}] generation [{}]", |
380 | | - translog.stats().getUncommittedSizeInBytes(), translog.stats().getUncommittedOperations(), translog.getGeneration()); |
| 381 | + final TranslogStats translogStats = translog.stats(); |
| 382 | + final CommitStats commitStats = shard.commitStats(); |
| 383 | + final FlushStats flushStats = shard.flushStats(); |
| 384 | + logger.info("--> translog stats [{}] gen [{}] commit_stats [{}] flush_stats [{}/{}]", |
| 385 | + Strings.toString(translogStats), translog.getGeneration().translogFileGeneration, |
| 386 | + commitStats.getUserData(), flushStats.getPeriodic(), flushStats.getTotal()); |
381 | 387 | assertFalse(shard.shouldPeriodicallyFlush()); |
382 | 388 | }); |
383 | 389 | assertEquals(0, translog.stats().getUncommittedOperations()); |
|
0 commit comments