Why translog_ops still greater than 0 after flush

I want to move shards between different kind of nodes in my cluster.

First, I stop write any docs into index and invoked POST my_idx/_flush to commit translog to lucene.
Then change the index.routing.allocation.require to move shards to target node.

In my expectation, it shoud have no more translog to operation during recovery since I have invoke flush already. However, _cat/recovery shows there still some translog_ops to play:

GET _cat/recovery/my_idx?v&h=i,s,t,ty,st,shost,thost,f,fp,b,bp,to,top

i      s t    ty   st   shost        thost         f  fp     b         bp     to      top
my_idx 0 1.6m peer done 10.116.9.117 10.116.13.71  12 100.0% 137420564 100.0% 5924976 100.0%
my_idx 1 1.2m peer done 10.116.24.41 10.116.13.174 12 100.0% 137853417 100.0% 5924324 100.0%

What is there difference here?

Thanks.

Seems translog_ops is the operation records store in translog files. During the recovery stage, source node will transfer all the translog file remains in disk to target node which will replay all the data operations if need.

Different from my early guess, _flush api does just sync data from translog to lucene index, but not necessary to delete old translog file. When and which translog to delete is determine by Translog retention.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.