You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Yuqi Du (Code Review)" <ge...@cloudera.org> on 2023/02/09 08:09:22 UTC

[kudu-CR] [tserver] KUDU-3446 Keep the order of appling the ops same as raft WAL

Hello Alexey Serbin, Ashwani Raina, Yingchun Lai, Kudu Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/19463

to look at the new patch set (#3).

Change subject: [tserver] KUDU-3446 Keep the order of appling the ops same as raft WAL
......................................................................

[tserver] KUDU-3446 Keep the order of appling the ops same as raft WAL

The order of tablet's write ops(including other raft logs) is in total order
on server-side. Appling them into kudu engine should be same as raft wal.
Currently, appling the ops using 'apply_pool->Submit'(i.e concurrent thread-pool),
may cause some ops to go out of order.

For example, 4 logs of 2 ops, we expected:
    replicate 1.1
    commit 1.1
    replicate 1.2
    commit 1.2
or
    replicate 1.1
    replicate 1.2
    commit 1.1
    commit 1.2

A incorrect order is:
    replicate 1.1
    replicate 1.2
    commit 1.2
    commit 1.1

That means 1.2 would become valid before 1.1 in kudu engine, that's not expected.
'apply_pool->Submit' cauld cause the incorrect order. More details can be found:
https://issues.apache.org/jira/browse/KUDU-3446.

This patch try to fix the problem by using apply_pool_token with SERIAL_MODE
created by apply_pool.

Change-Id: Id040122ab9473d1a8b03a2a1e751454a32b89d87
---
M src/kudu/tablet/ops/op_driver.cc
M src/kudu/tablet/ops/op_driver.h
M src/kudu/tablet/tablet_replica.cc
M src/kudu/tablet/tablet_replica.h
4 files changed, 50 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/63/19463/3
-- 
To view, visit http://gerrit.cloudera.org:8080/19463
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id040122ab9473d1a8b03a2a1e751454a32b89d87
Gerrit-Change-Number: 19463
Gerrit-PatchSet: 3
Gerrit-Owner: Yuqi Du <sh...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ar...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <la...@apache.org>
Gerrit-Reviewer: Yuqi Du <sh...@gmail.com>