Re: [ANNOUNCE] Ramback: faster than a speeding bullet

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Cox
Date: Monday, March 17, 2008 - 4:53 am

> You did not explain how your proposal will avoid dropping the transaction

I did but I've attached a much more complete explanation below.


Here is a simple but high physical storage using approach (but hey disks
are cheap)

You walk across the ram dirty table writing out chunks to backing
store 0.

At some point in time you want a consistent snapshot so you pick the next
write barrier point after this time and begin committing blocks dirtied
after that moment to store 1 (with blocks before that moment being
written to both). You don't permit more than one snapshot to be in
progress at once so at some point you clear all the blocks for store 0.
Your snapshotting interval is bounded by the time to write out the store,
nor do you have to throttle writes to the ramdisk.

You now have a consistent snapshot in store 0. At the next time interval
we finish off store 1 and spew new blocks to store 2, after 2 is complete
we go with 2, 0 and then 1 as the stable store.

The only other real trick needed then is metadata, but you don't have to
update that on disk too often and you only need two bits for each of the
page in RAM.

For any page it is either

00	Clean on stable store
01	Clean on current writing snapshot
10	Dirty on stable store (and thus both)
11	Dirty on current writing snapshot (but clean, old on stable)

Pages go 00->11 or 01->11 when they are touched, 11->01 or 10->01 when
they are written back.

At the point we freeze a snapshot we move 01->00 11->10 00->11 and there
are no pages in 10. And of course we don't update the big tables at this
instant instead we store the page state as

		(value - cycle_count)&3

with each freeze moment doing

		cycle_count++;

The 00->11 is perhaps not obvious but the logic is fairly simple. The
snapshot we are building does not magically contain the stable data from
a previous snapshot.

Say 0 is our stable snapshot
	snapshot 0 page 0 contains the stable copy of a page
	snapshot 1 is currently being updated

if we touched the page during the lifetime of snapshot 1 the newer data
will be written to snapshot 1, if not then snapshot 1 does not contain
useful data (it is stale). What we must not do is permit a situation to
occur where snapshot 0 is overwritten and holds the last stable copy of a
block. If we move from "clean on stable" store to "dirty on stable store"
then we know our worst case is
	
	Written on snapshot 0         (01)
	Not written to snapshot 1     (00)
	Dirty on current snapshot     (11)
	Written on snapshot 2	      (01)

The page sweeping algorithm is

00 -> do nothing (it may be cheaper to write the blocks and go to 01)
01 -> do nothing (ditto)
10 -> write to both stable and current snapshot, move to 01
11 -> write to current snapshot move to 01

adjust dirty counts, check if ready to flip.

The recovery algorithm is

	Read state snapshot number
	Read blocks from stable snapshot if written to it
	From previous snapshot if not

Thus we need to write a 'written this snapshot' table as we update a
snapshot - but it can lag and needs only be completed when we decide the
snapshot is 'done'. Until the point we switch stable snapshots the
metadata and data for the current writeout are not used so not relevant.

And there are far more elegant ways to do this, although some I suspect
may still be patented.


"to attain the highest possible transaction throughput with enterprise
scale reliability.

Well that is the problem I am interested in solving, but not the one you
seem to be working on.

Alan
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 9, 11:46 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Grzegorz Kulewski, (Mon Mar 10, 12:51 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Mon Mar 10, 1:23 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Artur Skawina, (Mon Mar 10, 7:51 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Chris Snook, (Mon Mar 10, 11:49 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Rik van Riel, (Mon Mar 10, 12:01 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Lars Marowsky-Bree, (Mon Mar 10, 2:03 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Mon Mar 10, 8:50 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Mon Mar 10, 9:23 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Mon Mar 10, 9:28 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Mon Mar 10, 10:22 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Tue Mar 11, 4:14 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Lars Marowsky-Bree, (Tue Mar 11, 4:23 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Tue Mar 11, 4:50 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Artur Skawina, (Tue Mar 11, 6:32 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Artur Skawina, (Tue Mar 11, 7:31 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Chris Friesen, (Tue Mar 11, 10:26 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Tue Mar 11, 12:56 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Willy Tarreau, (Tue Mar 11, 1:53 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Lars Marowsky-Bree, (Tue Mar 11, 2:56 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Tue Mar 11, 4:02 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Tue Mar 11, 4:30 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Wed Mar 12, 1:17 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, tvrtko.ursulin, (Wed Mar 12, 5:01 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Mike Snitzer, (Wed Mar 12, 7:41 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Wed Mar 12, 10:27 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Wed Mar 12, 10:29 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Chris Friesen, (Wed Mar 12, 11:11 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Wed Mar 12, 3:56 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Wed Mar 12, 10:39 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Wed Mar 12, 10:45 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Wed Mar 12, 11:14 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Wed Mar 12, 11:17 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Wed Mar 12, 11:30 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Wed Mar 12, 11:50 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Thu Mar 13, 12:05 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 12:12 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 12:13 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 1:06 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Matthias Schniedermeyer, (Thu Mar 13, 2:15 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 2:16 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 2:49 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Ric Wheeler, (Thu Mar 13, 6:27 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 12:02 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Ric Wheeler, (Thu Mar 13, 12:12 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 12:14 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 12:32 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 12:38 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Thu Mar 13, 12:50 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 1:03 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Rik van Riel, (Thu Mar 13, 1:27 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Rik van Riel, (Thu Mar 13, 1:34 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 7:20 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 7:23 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Thu Mar 13, 10:22 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Thu Mar 13, 10:42 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, John Stoffel, (Fri Mar 14, 7:00 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Jeff Moyer, (Fri Mar 14, 10:53 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Pavel Machek, (Sat Mar 15, 6:32 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Pavel Machek, (Sat Mar 15, 1:18 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 1:22 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Pavel Machek, (Sat Mar 15, 1:26 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Mike Snitzer, (Sat Mar 15, 1:40 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 1:51 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Willy Tarreau, (Sat Mar 15, 1:59 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 2:05 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 2:17 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 2:25 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Pavel Machek, (Sat Mar 15, 2:33 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 2:47 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 2:51 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Willy Tarreau, (Sat Mar 15, 2:54 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 3:00 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 3:33 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Bernd Eckenfels, (Sat Mar 15, 4:18 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Willy Tarreau, (Sat Mar 15, 4:22 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Krzysztof Halasa, (Sat Mar 15, 4:57 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sat Mar 15, 8:33 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Sat Mar 15, 10:24 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Sat Mar 15, 10:42 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Willy Tarreau, (Sat Mar 15, 11:56 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Theodore Tso, (Sun Mar 16, 12:04 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 1:48 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 2:57 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Krzysztof Halasa, (Sun Mar 16, 3:02 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Krzysztof Halasa, (Sun Mar 16, 3:12 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Krzysztof Halasa, (Sun Mar 16, 3:15 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 3:36 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 3:38 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Krzysztof Halasa, (Sun Mar 16, 4:08 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 4:39 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 4:43 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Sun Mar 16, 6:31 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 7:42 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 16, 10:52 pm)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Mon Mar 17, 12:14 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Mon Mar 17, 1:16 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Mon Mar 17, 1:25 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Alan Cox, (Mon Mar 17, 4:53 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Ric Wheeler, (Mon Mar 17, 6:52 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Willy Tarreau, (Mon Mar 17, 10:30 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, David Newall, (Mon Mar 17, 11:56 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Pavel Machek, (Sun Mar 23, 2:33 am)
Re: [ANNOUNCE] Ramback: faster than a speeding bullet, Daniel Phillips, (Sun Mar 23, 1:44 pm)