[Tarantool-patches] [PATCH] limbo: introduce request processing hooks

Cyrill Gorcunov gorcunov at gmail.com
Mon Jul 12 11:23:29 MSK 2021


On Mon, Jul 12, 2021 at 11:12:12AM +0300, Cyrill Gorcunov wrote:
> On Mon, Jul 12, 2021 at 10:04:56AM +0200, Vladislav Shpilevoy wrote:
> > > 
> > > And if we filter before the WAL write, we need the second vclock, which
> > > Cyrill has introduced.
> > 
> > Why do you need a second vclock? Why can't you just filter by the
> > existing vclock and update it after WAL write like now?
> 
> Because the phases are no longer atomic. We can pass "filter" stage,
> update our terms, but then WAL process failed (it doesn't matter for
> what reason, maybe single disk write failure) so we have to revert
> former term value back so the client will retry the operation and
> resend us the PROMOTE.

Here is kind of top-view over the code (an interesting snippet is
of course apply_synchro_row routine).

Current code

apply_synchro_row
  journal_write
    apply_synchro_row_cb
      txn_limbo_apply
        - update terms map
        - ignore bad promotes

Thus we just wrote bad promote into our WAL.

New approach

apply_synchro_row
  txn_limbo_apply(LIMBO_OP_FILTER)
    - update terms_infly if allowed
    - exit with error if prohibited
  journal_write
    - apply_synchro_row_cb if everything is fine
    - journal write failed
        txn_limbo_apply(LIMBO_OP_ERROR)
          restore terms_infly to previous _written_ value

	Cyrill


More information about the Tarantool-patches mailing list