[Tarantool-patches] [PATCH v2] recovery: make it yield when positioning in a WAL

Kirill Yukhin kyukhin at tarantool.org
Thu May 13 16:54:03 MSK 2021


On 12 май 14:29, Serge Petrenko via Tarantool-patches wrote:
> We had various places in box.cc and relay.cc which counted processed
> rows and yielded every now and then. These yields didn't cover cases,
> when recovery has to position inside a long WAL file:
> For example, when tarantool exits without leaving an empty WAL file
> which'll be used to recover instance vclock on restart. In this case
> the instance freezes while processing the last availabe WAL in order
> to recover the vclock.
> Another issue is with replication. If a replica connects and needs data
> from the end of a really long WAL, recovery will read up to the needed
> position without yields, making relay disconnect by timeout.
> In order to fix the issue, make recovery decide when a yield should
> happen. Once recovery decides so, it calls a xstream callback,
> schedule_yield. Currently schedule_yield is fired once recovery
> processes (either skips or writes) WAL_ROWS_PER_YIELD rows.
> schedule_yield either yields right away, in case of relay, or saves the
> yield for later, in case of local recovery, because it might be in the
> middle of a transaction.
> Closes #5979
> ---
> https://github.com/tarantool/tarantool/tree/sp/gh-5979-recovery-yield
> https://github.com/tarantool/tarantool/issues/5979

I've checked your patch into 2.7, 2.8, master.

Regards, Kirill Yukhin

More information about the Tarantool-patches mailing list