Comment

Comment by olafA

Thank you for taking the time to explains this. I am still a bit confused, if external consistency is not trying to solve global serial order, but only solving read from client point of view, such that all committed transaction before read timestamp will be returned and none of the transaction after read timestamp will be returned.

I am confused on why each data node have to wait 7ms to commit, isn't it easier to ask whichever client is reading to read from the maximum uncertainty timestamp?

Assume the following example

    nodeA is on time
    trxA arrive nodeA at (true time 7ms, A time 7ms, B time 0ms)
    trxA commit by nodeA at (true time 8ms, A time 8ms, B time 1ms)

    nodeB lag by 7ms
    trxB arrive nodeB at (true time 9ms, A time 9ms, B time 2ms)
    trxB is commit by nodeB at (true time 10ms, A time 10ms, B time 3ms)

    nodeD ahead by 7ms
    trxD arrive nodeD at (true time 9ms, D time 16ms, B time 2ms, A time 9ms)
    trxD commit by nodeD at (true time 10ms, D time 17ms, B time 3ms, A time 10ms)

For example if client C is reading and client C lags real world time by 7ms

    ClientC ask to read node A and B for transaction on real-world time 11ms local time 4ms 
    instead to ask all transaction before 4ms, ClientC will ask all transaction before 4ms + 2x_uncertainty(14ms) = 18ms

    trxA(8ms) < 18ms -> trxA will be read
    trxB(3ms) < 18ms -> trxB will be read
    trxD(17ms) < 18ms -> trxD will be read
Instead of asking each node to wait to commit timestamp, this guarantees any commit happened before read in real-world time is read, and none of the commit happend after read in real-world is read (since we are requesting read at the time read happens)
parent olafA 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton