Why TokuDB doesn't need double write?

44 views
Skip to first unread message

郭枫

unread,
Aug 24, 2015, 10:09:41 PM8/24/15
to tokudb-user
Since TokuDB doesn't need double write in InnoDB, how TokuDB gurantee atomic write ?(NVMFS and ZFS support atomic write so in these cases InnoDB doesn't need double write )

Leif Walsh

unread,
Aug 24, 2015, 10:32:17 PM8/24/15
to 郭枫, tokudb-user
Tokudb's block allocation is copy-on-write, so there is always a valid version of a block somewhere. Tokudb won't benefit from fs or hardware atomic writes, and anyway their block sizes might be too small. In any case they're probably just logging or doing copy on write themselves, so it's probably better to turn off those features if you're using tokudb. 

--
Cheers,
Leif


On Mon, Aug 24, 2015 at 10:09 PM, 郭枫 <leafo...@gmail.com> wrote:

Since TokuDB doesn't need double write in InnoDB, how TokuDB gurantee atomic write ?(NVMFS and ZFS support atomic write so in these cases InnoDB doesn't need double write )

--
You received this message because you are subscribed to the Google Groups "tokudb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tokudb-user...@googlegroups.com.
To post to this group, send email to tokud...@googlegroups.com.
Visit this group at http://groups.google.com/group/tokudb-user.
For more options, visit https://groups.google.com/d/optout.

郭枫

unread,
Aug 26, 2015, 9:36:07 PM8/26/15
to tokudb-user, leafo...@gmail.com
Do you mean?
For dml ,new block is copied and modified, even server crash, just new block is partial write, old block is still  intergrity, and redo log could be applied to old block to recovery?

在 2015年8月25日星期二 UTC+8上午10:32:17,Leif Walsh写道:

Leif Walsh

unread,
Aug 27, 2015, 10:03:53 AM8/27/15
to 郭枫, tokudb-user, leafo...@gmail.com
Exactly

--
Cheers,
Leif

郭枫

unread,
Aug 27, 2015, 10:46:18 PM8/27/15
to Leif Walsh, tokudb-user
Why TokuDB use COW other than InnoDB's double write?It seems IO overhead is same:In InnoDB,there are two IO(write);In TokuDB there are also two IO ( one read for old data+one write for new data)~I think reason is COW support snapshot,so MVCC is simple to implement,is that so?

Leif Walsh

unread,
Aug 27, 2015, 11:41:16 PM8/27/15
to 郭枫, tokudb-user
Innodb's pages are fixed-length so double-write makes more sense. Tokudb pages may change size depending how they compress, so COW is more suitable (and simpler to get right, IMO). 

--
Cheers,
Leif

Leif Walsh

unread,
Aug 27, 2015, 11:46:22 PM8/27/15
to 郭枫, tokudb-user
Also, for innodb, it may cost a read plus two writes...

--
Cheers,
Leif


On Thu, Aug 27, 2015 at 10:46 PM, 郭枫 <leafo...@gmail.com> wrote:

郭枫

unread,
Aug 28, 2015, 2:41:14 AM8/28/15
to Leif Walsh, tokudb-user
Thx~
Since variable page size is useful and flexible,do you know why InnoDB's page size is fixed in 4k、8k、16k、32k、64k........?

Leif Walsh

unread,
Aug 28, 2015, 12:38:55 PM8/28/15
to 郭枫, tokudb-user
Fixed-size allocation is very simple. Variable-size allocation is complex and full of tradeoffs. 

--
Cheers,
Leif

郭枫

unread,
Aug 28, 2015, 8:25:25 PM8/28/15
to Leif Walsh, tokudb-user
Thx~
Reply all
Reply to author
Forward
0 new messages