<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3514705510593466065</id><updated>2012-02-16T15:57:00.862-05:00</updated><category term='drizzle'/><category term='xcode'/><category term='conference'/><category term='mysql'/><category term='replication'/><title type='text'>Shrews News</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-4663126909738134861</id><published>2011-12-22T11:04:00.000-05:00</published><updated>2011-12-22T11:04:22.382-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><title type='text'>2011 Year In Review</title><content type='html'>Wow, what an insane year. Looking back on it, a &lt;i&gt;lot&lt;/i&gt; of stuff has happened this year for me. Let's look back:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;With the help of &lt;a href="http://www.wc220.com/" target="_blank"&gt;Patrick Crews&lt;/a&gt; and &lt;a href="http://www.linuxjedi.co.uk/" target="_blank"&gt;Andrew Hutchings&lt;/a&gt;, and building on the work of &lt;a href="http://www.joinfu.com/" target="_blank"&gt;Jay Pipes&lt;/a&gt;, I managed to implement a pretty solid replication solution in Drizzle and made &lt;a href="http://dshrewsbury.blogspot.com/2011/02/drizzles-slave-plugin-and-execute-class.html" target="_blank"&gt;the slave plugin&lt;/a&gt; available.&lt;/li&gt;&lt;li&gt;Implemented &lt;a href="http://dshrewsbury.blogspot.com/2011/03/multi-master-support-in-drizzle.html" target="_blank"&gt;multi-source replication&lt;/a&gt; (more accurate name than multi-master) in Drizzle.&lt;/li&gt;&lt;li&gt;I ventured into new territory by giving my &lt;a href="http://dshrewsbury.blogspot.com/2011/04/mysql-users-conference-slides.html" target="_blank"&gt;first-ever presentation&lt;/a&gt; at the &lt;a href="http://en.oreilly.com/mysql2011/" target="_blank"&gt;MySQL User Conference&lt;/a&gt; in Santa Clara, CA. &lt;/li&gt;&lt;li&gt;Rackspace made life interesting and forced me find another position. I joined a &lt;a href="http://www.windsorcircle.com/" target="_blank"&gt;local startup company&lt;/a&gt; as their first real hire. Two of the founders are former coworkers and current friends of mine, and the timing worked out well for all parties.&lt;/li&gt;&lt;li&gt;For my new job, I had to learn Python, GIT, and how to work with &lt;a href="http://aws.amazon.com/" target="_blank"&gt;AWS systems&lt;/a&gt;. Python rocks. I feel like &lt;a href="http://xkcd.com/353/" target="_blank"&gt;I can fly now&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Lost 20 lbs! Woohoo!&lt;/li&gt;&lt;/ul&gt;The new job has kept me unbelievably busy, so I haven't had the time to contribute more to Drizzle, other than a bug fix here or there. That makes me a sad panda, but priorities have changed. Perhaps next year will offer more opportunity.&lt;br /&gt;&lt;br /&gt;I don't know what 2012 has in store for me, but hopefully it is just as exciting. I hope everyone has a Happy New Year.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-4663126909738134861?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/4663126909738134861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/12/2011-year-in-review.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/4663126909738134861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/4663126909738134861'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/12/2011-year-in-review.html' title='2011 Year In Review'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-7621551279582329599</id><published>2011-12-21T08:45:00.000-05:00</published><updated>2011-12-21T08:45:18.450-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='conference'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Going to Percona Live in DC</title><content type='html'>I'm looking forward to attending &lt;a href="http://www.percona.com/live/dc-2012/" target="_blank"&gt;Percona Live in DC&lt;/a&gt; next month. If you're on the east coast of the US and you use MySQL in any capacity, you need to be there. Who's coming?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-7621551279582329599?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/7621551279582329599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/12/going-to-percona-live-in-dc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/7621551279582329599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/7621551279582329599'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/12/going-to-percona-live-in-dc.html' title='Going to Percona Live in DC'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-4141597264446686950</id><published>2011-04-15T15:52:00.000-04:00</published><updated>2011-04-15T15:52:35.495-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>MySQL Users Conference Slides</title><content type='html'>Slides for my talk at the 2011 MySQL Users Conference are now up:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://en.oreilly.com/mysql2011/public/schedule/detail/17410"&gt;http://en.oreilly.com/mysql2011/public/schedule/detail/17410&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All in all, the talk went pretty well. There was quite a bit of interest in the subject. After attending my talk, Jay Janssen of Yahoo! put up a &lt;a href="http://mysqlguy.net/blog/2011/04/13/proposal-some-features-drizzle-async-replication"&gt;good blog post&lt;/a&gt; about some replication features that he would like to see in future versions. That is exactly the type of feedback that we want. Open source projects should be community driven. We want to implement the features that YOU want.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-4141597264446686950?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/4141597264446686950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/04/mysql-users-conference-slides.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/4141597264446686950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/4141597264446686950'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/04/mysql-users-conference-slides.html' title='MySQL Users Conference Slides'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-6133415590034346398</id><published>2011-03-19T16:58:00.000-04:00</published><updated>2011-03-19T16:58:02.501-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Multi-Master Support in Drizzle Replication</title><content type='html'>So &lt;a href="http://krow.livejournal.com/"&gt;Brian&lt;/a&gt; asked me the other day what it would take to support multiple masters in our new Drizzle slave plugin. Not master to master replication, but multiple masters sending replication events to a single slave that simply ignores any conflicts and just chugs along. I told him I didn't know, but considering how simple the code is, it probably wouldn't take much.&lt;br /&gt;&lt;br /&gt;To get a better understanding of what exactly would be involved in supporting multiple masters, I decided to just start hacking it up. I did this mainly to get a sense of what would need to be changed, since my original design didn't allow for this at all. (Shortsightedness on my part I suppose.)&lt;br /&gt;&lt;br /&gt;So I have a beta version of my results available in this Launchpad branch:&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;lp:~dshrews/drizzle/beta-multi-master&lt;/span&gt;&lt;/blockquote&gt;From my simple tests, it seems to work. I'm not real happy with the code (like I said, this was a hack), but functionality is there. I'm not promising this will go into Drizzle trunk just yet. I would like to make some improvements on it, and I'd really like to get some feedback from people on it.&lt;br /&gt;&lt;br /&gt;To use it, you'll first need to create a modified slave configuration file. Here is a sample one:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;ignore-errors&lt;br /&gt;&lt;br /&gt;[master1]&lt;br /&gt;master-host = foo.my.domain&lt;br /&gt;master-port = 3306&lt;br /&gt;master-user = user1&lt;br /&gt;master-pass = password&lt;br /&gt;&lt;br /&gt;[master2]&lt;br /&gt;master-host = bar.my.domain&lt;br /&gt;master-port = 3306&lt;br /&gt;master-user = user2&lt;br /&gt;master-pass = password&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Currently, a total of 10 masters are supported. This was an arbitrary number. It was simplest to just predetermine a set number of masters due to some complications with config file parsing which I wasn't prepared to solve (this is one of the things I want to see fixed). One IO thread per master will be started, though we still use a single applier thread for the time being.&lt;br /&gt;&lt;br /&gt;You'll notice in the sample config a new option, &lt;i&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;ignore-errors&lt;/span&gt;&lt;/i&gt;. If this option is present, the slave ignores any errors from replication events received from the masters that it executes locally. I highly recommend you have this option enabled. Also note the addition of the &lt;i&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;[master1]&lt;/span&gt;&lt;/i&gt; and &lt;i&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;[master2]&lt;/span&gt;&lt;/i&gt; sections that define options for each master. You can go all the way to a &lt;i&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;[master10]&lt;/span&gt;&lt;/i&gt; section.&lt;br /&gt;&lt;br /&gt;Nothing changes with how you start your slave or masters (see my post on &lt;a href="http://dshrewsbury.blogspot.com/2011/03/simple-drizzle-replication-example.html"&gt;setting up a simple replication example&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Give it a try and let me know how it works for you. Again, this is bleeding edge stuff (does any other database support this? &amp;nbsp;:) ), so be prepared for bugs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-6133415590034346398?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/6133415590034346398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/multi-master-support-in-drizzle.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/6133415590034346398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/6133415590034346398'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/multi-master-support-in-drizzle.html' title='Multi-Master Support in Drizzle Replication'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-7097639777431127330</id><published>2011-03-17T09:07:00.000-04:00</published><updated>2011-03-17T09:07:13.611-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><title type='text'>Installing Drizzle from Source on OS X</title><content type='html'>Installing Drizzle on OS X 10.6 is pretty simple. &lt;a href="http://wiki.drizzle.org/Compiling/MacOS_X"&gt;We have a page on our wiki&lt;/a&gt; that has the basic steps, but I thought that I'd detail what I do on my Macs in the hope that it may make someone's life easier.&amp;nbsp;Note that we don't build on any 10.5 machines, and I don't use that version anymore, so YMMV with these instructions. Also, these instructions assume that you have the Xcode package already installed. I have Xcode 4 installed, but these instructions should work with Xcode 3, too. If they don't, let me know.&lt;br /&gt;&lt;br /&gt;I used to use MacPorts on my Macs to install the necessary libraries that are needed by Drizzle. I've recently dumped that because I didn't like all of the extra stuff that was installed (do you &lt;i&gt;really&lt;/i&gt;&amp;nbsp;need to install a separate Perl installation?). And a recent b0rk of their Perl installations was the final straw.&lt;br /&gt;&lt;br /&gt;It turns out that all you really need are just a few extra packages to build Drizzle on your Mac. Here are the packages that I currently have installed on my machines:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.gnu.org/software/autoconf/"&gt;autoconf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.gnu.org/software/automake/"&gt;automake&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.gnu.org/software/libtool/"&gt;libtool&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.pcre.org/"&gt;pcre&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.boost.org/users/download/"&gt;boost&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/protobuf/downloads/list"&gt;protobuf&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The first three (autoconf, automake, and libtool) aren't strictly necessary. I install those because I want newer versions of those tools than what OS X provides by default. It makes building a little bit nicer (the output is much cleaner). The last three are what you really need.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Each package has its own instructions for how to compile and install. I use the default installation path (/usr/local) for each. Basically, building and installing for each is simply:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;./configure&lt;/li&gt;&lt;li&gt;make&lt;/li&gt;&lt;li&gt;sudo make install&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The Boost package is the lone exception:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;./bootstrap.sh&lt;/li&gt;&lt;li&gt;./bjam&lt;/li&gt;&lt;li&gt;sudo ./bjam install&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;If you install the &lt;i&gt;libtool&lt;/i&gt;&amp;nbsp;package, there is one additional step you should do. That package installs the binaries &lt;i&gt;libtool&lt;/i&gt;&amp;nbsp;and &lt;i&gt;libtoolize&lt;/i&gt;&amp;nbsp;into /usr/local/bin. I rename these to &lt;i&gt;glibtool&lt;/i&gt;&amp;nbsp;and &lt;i&gt;glibtoolize&lt;/i&gt;, respectively. The Drizzle build system looks for these program names.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The last thing I do is to make sure that /usr/local/bin is in my path. So in &lt;i&gt;$HOME/.bash_profile&lt;/i&gt;, I have this line:&lt;/div&gt;&lt;blockquote&gt;export PATH=/usr/local/bin:$PATH&lt;/blockquote&gt;With all that in place, to build Drizzle is just:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;./config/autorun.sh&lt;/li&gt;&lt;li&gt;./configure&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;No need to add any extra options to &lt;i&gt;configure&lt;/i&gt;&amp;nbsp;to find libraries.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-7097639777431127330?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/7097639777431127330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/installing-drizzle-from-source-on-os-x.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/7097639777431127330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/7097639777431127330'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/installing-drizzle-from-source-on-os-x.html' title='Installing Drizzle from Source on OS X'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-7453747857217592898</id><published>2011-03-09T11:21:00.000-05:00</published><updated>2011-03-09T11:21:02.602-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Simplest Test Replication Setup. Ever.</title><content type='html'>&amp;gt; cd tests&lt;br /&gt;&amp;gt; ./dbqp --mode=randgen --start-and-exit --suite=slave_plugin&lt;br /&gt;&lt;br /&gt;BOOM. DONE. WINNING.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-7453747857217592898?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/7453747857217592898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/simplest-test-replication-setup-ever.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/7453747857217592898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/7453747857217592898'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/simplest-test-replication-setup-ever.html' title='Simplest Test Replication Setup. Ever.'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-3560963776582352205</id><published>2011-03-08T08:06:00.001-05:00</published><updated>2011-03-08T08:51:54.749-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Simple Drizzle Replication Example Using the Slave Plugin</title><content type='html'>In this blog post, I thought that I'd cover, in a bit more detail, setting up a simple replication setup between two drizzle servers using the new replication slave plugin. If you've used MySQL replication before, you should find some of the concepts very similar. I'll only cover the simplest of examples (single master, single slave) and also explain how to provision a new slave into an existing setup.&lt;br /&gt;&lt;br /&gt;So you've downloaded the latest and greatest version of Drizzle and want to setup replication. Where do you start? The very first thing to do is to make certain that both master and slave share the same version of Drizzle to avoid any potential incompatibility issues. Then you setup your master.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;u&gt;Master Setup&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Setting up the master is the easiest step. The only thing you really have to do here is to make sure that the master Drizzle database server is started with the &lt;i&gt;--innodb.replication-log&lt;/i&gt; option. Something along the lines of:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;master&amp;gt; sbin/drizzled --datadir=$PWD/var --innodb.replication-log &amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;For more complex setups, you'll also want to consider using the &lt;i&gt;--server-id&lt;/i&gt; option, but the default for that is fine for this example. That option is &lt;a href="http://docs.drizzle.org/options.html"&gt;documented here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;With the master running, you can optionally now create a backup of any databases to be imported on the new slave. You would use &lt;a href="http://docs.drizzle.org/clients/drizzledump.html"&gt;drizzledump&lt;/a&gt; to make such a backup. In this example, I'm keeping it simple and assuming that we are starting with a fresh database with no data.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;u&gt;Slave Setup&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now that you have the master running, you can setup your slave. Starting the slave is almost as simple as starting the master. You will need to use two options to the Drizzle database server on the slave: &lt;i&gt;--plugin-add=slave&lt;/i&gt; and &lt;i&gt;--slave.config-file&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;slave&amp;gt; sbin/drizzled --datadir=$PWD/var \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--plugin-add=slave \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--slave.config-file=/tmp/slave.cfg &amp;amp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;These options tell the server to load the slave plugin, and then tells the slave plugin where to find the slave host configuration file. This configuration file has options to specify the master host and a few options to control how the slave operates. You can read more about the available configuration options in the &lt;a href="http://docs.drizzle.org/plugins/slave/index.html"&gt;replication slave plugin documentation&lt;/a&gt;. Below is a simple example:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;master-host = kodiak&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;master-port = 3306&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;master-user = kodiak_slave&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;master-pass = my_password&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;io-thread-sleep = 10&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;applier-thread-sleep = 10&lt;br /&gt;&lt;br /&gt;Most of these options have sensible defaults, and it should be pretty obvious what most of them are for. The plugin documentation referenced above describes them in more complete detail if you need more information.&lt;br /&gt;&lt;br /&gt;So once you start the slave as described above, it will immediately connect to the master host specified in the configuration file and begin pulling events from the &lt;a href="http://docs.drizzle.org/plugins/innobase/index.html"&gt;InnoDB-based transaction log&lt;/a&gt;. By default, a freshly provisioned slave will begin pulling from the beginning of this transaction log. Once all replication messages have been pulled from the master and stored locally on the slave host, the IO thread will sleep and periodically awaken to check for more messages. That's all fine and dandy for your first slave machine in a brand new replication setup, but how do you insert another slave host into an already existing replication architecture? I'm glad you asked!&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Provisioning a New Slave Host&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;We've recently made some changes that makes provisioning a new slave host very easy.&lt;br /&gt;&lt;br /&gt;So, the basic formula for creating a new slave host for an existing replication setup is:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Make a backup of the master databases.&lt;/li&gt;&lt;li&gt;Record the state of the master transaction log at the point the backup was made.&lt;/li&gt;&lt;li&gt;Restore the backup on the new slave machine.&lt;/li&gt;&lt;li&gt;Start the new slave and tell it to begin reading the transaction log from the point recorded in #2.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Steps #1 and #2 are covered with the &lt;a href="http://docs.drizzle.org/clients/drizzledump.html"&gt;drizzledump&lt;/a&gt; client program. If you use the &lt;i&gt;--single-transaction&lt;/i&gt; option to drizzledump, it will place a comment near the beginning of the dump output with the InnoDB transaction log metadata. For example:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;master&amp;gt; drizzledump --all-databases --single-transaction &amp;gt; master.backup&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;master&amp;gt; head -1 master.backup&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;i&gt;-- SYS_REPLICATION_LOG: COMMIT_ID = 33426, ID = 35074&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The SYS_REPLICATION_LOG line gives us the replication log metadata we need when we start a new slave. It has two pieces of information:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;COMMIT_ID - This value is the commit sequence number recorded for the most recently executed transaction stored in the transaction log. We can use this value to determine proper commit order within the log. The unique transaction ID cannot be used since that value is assigned when the transaction is started, not when it is committed.&lt;/li&gt;&lt;li&gt;ID - This is the unique transaction identifier associated with the most recently executed transaction stored in the transaction log.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;With this step done, we can now do steps #3 and #4 to start the new slave. First, you must start the slave WITHOUT the replication slave plugin enabled. We don't want it reading from the master until we've imported the backup. So start it without the plugin enabled, import your backup, then shutdown the server:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;slave&amp;gt; sbin/drizzled --datadir=$PWD/var &amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;slave&amp;gt; drizzle &amp;lt; master.backup&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;slave&amp;gt; drizzle --shutdown&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that the backup is imported, we can restart the slave with the replication slave plugin enabled and use a new option, &lt;i&gt;--slave.max-commit-id&lt;/i&gt;, to force the slave to begin reading the master's transaction log at the proper location:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;slave&amp;gt; sbin/drizzled --datadir=$PWD/var \&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--plugin-add=slave \&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--slave.config-file=/tmp/slave.cfg \&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;--slave.max-commit-id=33426 &amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;We give the &lt;i&gt;--slave.max-commit-id&lt;/i&gt; the value from the comment in the master dump file which defines the maximum COMMIT_ID value (the latest transaction) represented by the slave's contents.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So that's all there is to it. I hope you find this example useful and it encourages you to begin trying out Drizzle replication. Be sure to report any bugs and enhancements you'd like to see to our &lt;a href="https://bugs.launchpad.net/drizzle"&gt;bug system&lt;/a&gt;. And don't forget that we have Drizzle Developer Day after the MySQL User Conference this year on April 15th. Be sure to &lt;a href="http://drizzle.org/"&gt;sign up for that&lt;/a&gt; and come chat with us face-to-face about replication and anything else Drizzle related. &amp;nbsp;:)&lt;br /&gt;&lt;br /&gt;Happy Replicating.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-3560963776582352205?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/3560963776582352205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/simple-drizzle-replication-example.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/3560963776582352205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/3560963776582352205'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/03/simple-drizzle-replication-example.html' title='Simple Drizzle Replication Example Using the Slave Plugin'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-2030878645201538734</id><published>2011-02-25T11:45:00.000-05:00</published><updated>2011-02-25T11:45:34.995-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Drizzle's Slave Plugin and the Execute class</title><content type='html'>Well, you may have already read &lt;a href="http://www.linuxjedi.co.uk/?p=96"&gt;Andrew's&lt;/a&gt; and &lt;a href="http://www.wc220.com/?p=135"&gt;Patrick's&lt;/a&gt; blog posts on it, but if you haven't, we now have a Drizzle plugin that implements native replication between Drizzle servers.&lt;br /&gt;&lt;br /&gt;So, the initial plan was to support work by the community to have Tungsten Replicator ready as a replication solution for our first GA release. However, this didn't look like it would get completed in time for GA, so the decision was made to make a strong push to get a native solution ready. So after a big group effort, and many, many late nights and long weekends, we are pleased to say that we have delivered the initial version of a native replication solution.&lt;br /&gt;&lt;br /&gt;Now, does this version have all of the features that we want? No. It will certainly be added to, though, as we progress. Keep in mind that replication was totally ripped out of Drizzle, so it will take some time to build on its functionality.&lt;br /&gt;&lt;br /&gt;But what makes this release so exciting if it doesn't have all the features you want? Well, thanks to the solid backbone of a well tested transaction log and a well designed and flexible replication architecture (big shout out to &lt;a href="http://www.joinfu.com/"&gt;Jay&lt;/a&gt;), it took only 2 weeks (admittedly, 2 very hard weeks) and 1900 lines of C++ code to implement this plugin. With only 1900 LOC, it is extremely simple to understand and expand on and improve. A kid just out of college could understand this. &amp;nbsp;:) &amp;nbsp;So if you want to add a cool feature to the plugin, it shouldn't take too much effort to add your contribution. How easily could you do this in any other database?&lt;br /&gt;&lt;br /&gt;Patrick has already &lt;a href="http://www.wc220.com/?p=135"&gt;blogged&lt;/a&gt; about how easy it is to begin using the replication slave plugin. It should hit our main trunk later today, so feel free to give it a try. In later posts, I'll attempt to cover some of the implementation details, but there is one REALLY cool feature in Drizzle that is used by the slave plugin that I want to quickly cover...&lt;br /&gt;&lt;br /&gt;The slave plugin has to execute SQL statements on the local server to apply the changes from the master. In the MySQL code, executing SQL locally isn't easy to do. Logically, you would think that it should be easy for a database kernel to execute SQL on itself. Alas, this was not the case.&lt;br /&gt;&lt;br /&gt;Thanks to some changes by &lt;a href="http://krow.livejournal.com/"&gt;Brian Aker&lt;/a&gt; to the Drizzle kernel, the slave plugin can very easily do this by using the drizzled::Execute class. This class has a run() method that takes a std::string with the SQL to execute. Here is a simple example from the slave plugin code:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Execute execute(*(_session.get()), true);&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;string sql("SELECT `trx_id` FROM `sys_replication`.`queue`"&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; " WHERE `commit_order` IS NOT NULL ORDER BY `commit_order` ASC");&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;sql::ResultSet result_set(1);&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;execute.run(sql, result_set);&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;It's as simple as that. Execute wraps whatever SQL you give it (it can be multiple statements) in a transaction and executes it. The ResultSet object will contain your results and any exceptions that may have been thrown (we are trying to match the JDBC API here). &amp;nbsp;Some of this API is still a work-in-progress, but it has proven to be extremely useful and solid so far. If you are interested, you can look at the Execute class source in the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;drizzled/execute.h&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;drizzled/execute.cc&lt;/span&gt; files.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-2030878645201538734?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/2030878645201538734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/02/drizzles-slave-plugin-and-execute-class.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/2030878645201538734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/2030878645201538734'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/02/drizzles-slave-plugin-and-execute-class.html' title='Drizzle&apos;s Slave Plugin and the Execute class'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-1105221501308722134</id><published>2011-01-20T13:55:00.000-05:00</published><updated>2011-01-20T13:55:35.749-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Transaction Log Quality and the Importance of QA</title><content type='html'>If you read my post a few months back that gave a &lt;a href="http://dshrewsbury.blogspot.com/2010/10/drizzle-replication-progress-report.html"&gt;progress report on Drizzle Replication&lt;/a&gt;, you know that our major focus lately has been the quality of the transaction log. It has to be solid before other things can be built upon it. And fixing bugs in it usually means fixing bugs in the core replication message stream, so other replication plugins will benefit as well.&lt;br /&gt;&lt;br /&gt;Well, &lt;a href="http://www.wc220.com/"&gt;Patrick Crews&lt;/a&gt;, the Drizzle QA Superman, has sent this post to the drizzle-discuss mailing list:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://lists.launchpad.net/drizzle-discuss/msg07354.html"&gt;https://lists.launchpad.net/drizzle-discuss/msg07354.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It looks like we finally have a high-quality transaction log to build on! With that solid foundation in place, we can now work on adding more functionality.&lt;br /&gt;&lt;br /&gt;This, of course, couldn't have happened with some super high quality QA work. Any developers out there know that finding your own flaws in code you maintain is difficult to do. You're too close to the code, can't see the forest for the trees. Sure, you'll find the obvious ones whenever you get a core dump, or when some unit or regression test fails (you do have those, right?). It's the super-hard-to-find-make-you-wish-you-chose-another-career bugs that are the ones that are usually missed. Sometimes because once we code it, we want to move on to something else as quickly as possible, so we'd like to assume that it works. The reality is usually different...&lt;br /&gt;&lt;br /&gt;This is where QA comes in. Their job is to pull the reins in on you, show you where you messed up, and make sure it gets fixed. It's usually a thankless job, but it's also one that is absolutely necessary. Patrick continually amazes me at what he does and how thorough he is. How we got lucky enough to snag him for the Drizzle team is beyond me, but I'm glad we did. Without his QA expertise, we'd certainly be quite lagging in the quality of our product. (He would try to give us developers the credit for fixing the bugs, but we are the ones&amp;nbsp;&lt;i&gt;introducing&lt;/i&gt;&amp;nbsp;the bugs to begin with!)&lt;br /&gt;&lt;br /&gt;So never underestimate the value of your QA team. You can't make a quality product without them. And have you thanked your QA team lately? &amp;nbsp;(Thanks Patrick!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-1105221501308722134?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/1105221501308722134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/01/transaction-log-quality-and-importance.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/1105221501308722134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/1105221501308722134'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/01/transaction-log-quality-and-importance.html' title='Transaction Log Quality and the Importance of QA'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-923804663611231326</id><published>2011-01-12T09:47:00.000-05:00</published><updated>2011-01-12T09:47:09.569-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Change in Transaction Protobuf Message Segmenting</title><content type='html'>If you read my post on &lt;a href="http://dshrewsbury.blogspot.com/2010/08/drizzle-transaction-message-limit.html"&gt;Drizzle transaction message limits&lt;/a&gt;, you know that it is possible to have multiple Transaction protobuf messages (segments) for a single database transaction. This was necessary to keep the Google protobuf messages from growing too large (there is a maximum limit on message size).&lt;br /&gt;&lt;br /&gt;Before my most recent change, you would have to parse each Statement sub-message contained within the enclosing Transaction message to see if the Transaction was split up into multiple messages (they would be linked together by sharing the same transaction ID). This was kind of a pain, but since the segment information was only contained in the Statement, this was the only way to do it.&lt;br /&gt;&lt;br /&gt;As of Bazaar revision number 2076 of the Drizzle trunk, we now have segment information stored in the Transaction message in addition to the Statement message. We added the values&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;segment_id&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end_segment&lt;/span&gt;&amp;nbsp;to the Transaction message definition. These are just like the identically named values in the Statement message definition. From the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;drizzled/message/transaction.proto&lt;/span&gt; definition file:&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;message Transaction&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;required TransactionContext transaction_context = 1;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;repeated Statement statement = 2;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;optional Event event = 3;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;/*&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * A single transaction in the database can possibly be represented with&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * multiple protobuf Transaction messages if the message grows too large.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * This can happen if you have a bulk transaction, or a single statement&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * affecting a very large number of rows, or just a large transaction with&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * many statements/changes.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; *&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * For the first two examples, it is likely that the Statement sub-message&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * itself will get segmented, causing another Transaction message to be&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * created to hold the rest of the Statement's row changes. In these cases,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * it is enough to look at the segment information stored in the Statement&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * message.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; *&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * For the last example, the Statement sub-messages may or may not be&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * segmented, but we could still need to split the Statements up into&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * multiple Transaction messages to keep the Transaction message size from&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * growing too large. In this case, the segment information in the Statement&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * submessages is not helpful if the Statement isn't segmented. We need this&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * information in the Transaction message itself.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; *&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * These values should be set appropriately whether or not the Statement&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; * sub-messages are segmented.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;optional uint32 segment_id = 4; /* Segment number of the Transaction msg */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;optional bool end_segment = 5; &amp;nbsp;/* FALSE if Transaction msg is split into multiples */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;So other than making it easier to check to see if a Transaction is segmented, why add these new values?&lt;br /&gt;&lt;br /&gt;Well, it turns out having the segment information only in the Statement doesn't allow us to segment large Transaction messages if none of the Statement sub-messages are themselves segmented. This is documented in &lt;a href="https://bugs.launchpad.net/drizzle/+bug/686781"&gt;this bug report&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-923804663611231326?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/923804663611231326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2011/01/change-in-transaction-protobuf-message.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/923804663611231326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/923804663611231326'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2011/01/change-in-transaction-protobuf-message.html' title='Change in Transaction Protobuf Message Segmenting'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-9174548349497219472</id><published>2010-12-10T09:39:00.001-05:00</published><updated>2010-12-10T09:40:23.688-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Drizzle Transaction Log and Statement Rollbacks</title><content type='html'>First off, apologies to those who left comments on my past posts and your comments didn't show up. Apparently, I didn't have my blog settings setup correctly, and I just noticed (and approved) them.&lt;br /&gt;&lt;br /&gt;So for the past few weeks, &lt;a href="http://www.wc220.com/"&gt;Patrick Crews&lt;/a&gt; and myself have been trying to chase down a really nasty transaction log bug that has been showing up under heavy load. The transaction log would end up not accurately representing the changes that took place in the server. Obviously, that's bad... unless you don't care if your slaves are an accurate representation of your master.&lt;br /&gt;&lt;br /&gt;This has been a crazy difficult bug to track down, partly due to the fact that the cause appears to be&amp;nbsp;&lt;i&gt;multiple&lt;/i&gt;&amp;nbsp;bugs. We've identified at least two bugs that are leading to transaction log inconsistency, one of which is how we deal with SQL statements that fail mid-execution.&amp;nbsp;(The other, we believe, has to do with savepoints, and we're still working on that one.)&lt;br /&gt;&lt;br /&gt;For the statement rollback bug, there were two problems:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;We were not correctly removing recorded row changes when a statement affecting multiple rows failed after changing the first row.&lt;/li&gt;&lt;li&gt;Because we can now segment a single statement's row changes across &lt;a href="http://dshrewsbury.blogspot.com/2010/08/drizzle-transaction-message-limit.html"&gt;multiple Transaction messages&lt;/a&gt; (due to having a max message size), we had no way to rollback transaction log changes made by a failed statement once it had been split up into multiple messages.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;For issue #1, consider this statement:&lt;/div&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;INSERT INTO t1 (not_null_column) VALUES (&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;'abc'&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;),(&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;'def'&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;),(&lt;/span&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;NULL&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;As each row is inserted, the in-memory protobuf message recording the transaction row changes is updated to include the row inserts. As we insert into this column which does not allow NULLs, we'll get changes recorded for values 'abc' and 'def'. However, once we try to insert NULL, the statement fails and InnoDB rolls back the two inserted rows. These two rows were not being removed from the in-memory message structure, which later gets sent through the replication stream and written to the transaction log, thus the inconsistency. The fix is fairly straightforward in that we just recognize the error, then remove the entries before sending the protobuf message downstream.&lt;br /&gt;&lt;br /&gt;For issue #2, the situation is similar to issue #1, except that once row changes were sent through the replication stream (i.e., recorded in the transaction log file), we had no way to undo them if the current statement was still active and ended up failing. We decided to resolve this by adding a new protobuf Statement message type: ROLLBACK_STATEMENT.&lt;br /&gt;&lt;br /&gt;The implications of this new Statement type? The first is that we now need to be able to clearly identify statement boundaries so we know how much work to undo. That means we no longer "roll up" like SQL statements into the same protobuf Statement message as an optimization for space (this avoided repeating the header information for the Statement message). So now each row-changing SQL statement executed gets its very own protobuf Statement message.&lt;br /&gt;&lt;br /&gt;The second implication is that readers of the transaction log file need to be able to either:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;rollback statements (you could conceivably use savepoints for this), &lt;i&gt;&lt;b&gt;or&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;cache Statement messages until the end segment is seen (which it can then execute the changes) or discard the cached messages if the next read Statement is a ROLLBACK_STATEMENT type.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;These changes are now in our trunk. And major props to &lt;a href="http://www.flamingspork.com/blog/"&gt;Stewart&lt;/a&gt; who helped us identify and fix this bug using his &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;storage_engine_api_tester&lt;/span&gt; &lt;a href="http://www.flamingspork.com/blog/2010/11/29/a-more-complete-look-at-storage-engine-api/"&gt;plugin&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-9174548349497219472?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/9174548349497219472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2010/12/drizzle-transaction-log-and-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/9174548349497219472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/9174548349497219472'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2010/12/drizzle-transaction-log-and-statement.html' title='Drizzle Transaction Log and Statement Rollbacks'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-6466528552485488273</id><published>2010-10-21T14:21:00.000-04:00</published><updated>2010-10-21T14:21:12.227-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Drizzle Replication Progress Report</title><content type='html'>In an attempt to keep folks up-to-date as to what is happening with Drizzle replication, I thought that I'd blog about what we are currently doing, and where we are heading.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: purple;"&gt;&lt;b&gt;Current Area of Focus&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A building is only as solid as its foundation. For Drizzle replication,&amp;nbsp;that foundation is the transaction log. Our focus, as of late, has been&amp;nbsp;testing the transaction log heavily, ensuring that the messages within it&amp;nbsp;are correct and that its contents can be successfully used to replicate to&amp;nbsp;another machine and have an exact copy of our data. Myself, &lt;a href="http://www.wc220.com/"&gt;Patrick Crews&lt;/a&gt; (awesome QA guy), and &lt;a href="http://www.8bitsofbytes.com/"&gt;Joe Daly&lt;/a&gt; (awesome contributor) have been focused on this testing and fixing bugs for the last several weeks. &lt;a href="https://blueprints.launchpad.net/drizzle/+spec/test-transaction-log"&gt;This Launchpad Blueprint&lt;/a&gt; tracks our progress and list of bugs. And Patrick has posted some &lt;a href="http://blog.drizzle.org/2010/07/09/testing-drizzles-transaction-log/"&gt;blog&lt;/a&gt; &lt;a href="http://www.wc220.com/?p=58"&gt;entries&lt;/a&gt; about this work.&lt;br /&gt;&lt;br /&gt;Initially we started&amp;nbsp;out simple with a single database session. This helped to uncover many issues,&amp;nbsp;most of which have been fixed. We have now moved on to testing our transaction&amp;nbsp;log with many concurrent database connections. The results are looking very&amp;nbsp;good so far!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: purple;"&gt;Next Steps&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In its simplest form, replication can be achieved by just shipping the transaction log file from master to slave and applying it to the slave. Drizzle obviously needs a solution for this since we do not yet have a native implementation of replication. So we've decided that as a first-phase replication solution, we'll use a 3rd party solution to help us.&lt;br /&gt;&lt;br /&gt;I looked at a few options at how we could implement this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.rabbitmq.com/"&gt;RabbitMQ&lt;/a&gt; - This is a message exchange system that would allow us to simply send our Google Protobuf Messages (the basic unit of communication in our replication architecture) from the master's transaction log (or alternatively, as a plugin reading the replication stream directly from the Drizzle kernel) to a server running RabbitMQ. Slaves could then connect to the RabbitMQ server to receive the replication events. This has the benefit of moving much of the I/O associated with replication off to another machine. Also, we already have a&amp;nbsp;&lt;a href="http://developian.blogspot.com/2010/01/replicating-transactions-directly-to.html"&gt;plugin&lt;/a&gt; created by &lt;a href="http://developian.blogspot.com/"&gt;Marcus Eriksson&lt;/a&gt; that will send the replication events to a RabbitMQ server. He also has an &lt;a href="http://www.rabbitreplication.org/"&gt;applier&lt;/a&gt; that will run on the slave to receive the events and apply them to the database.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.zeromq.org/"&gt;ZeroMQ&lt;/a&gt;&amp;nbsp;- Someone suggested that I look at this. This is an asynchronous message-processing library that looks really interesting. However, this is a networking library and would be more appropriate to use this in a native replication solution, which is a possibility in the future.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.continuent.com/community/tungsten-replicator"&gt;Tungsten Replicator&lt;/a&gt; - Continuent supplies an open source solution for replication for multiple database platforms (notably MySQL and Postgres). It provides some wonderful features, like easy promotion of slave to master in case of failure, and filtering of transaction log events.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;ZeroMQ doesn't really fit what I was looking for in this phase (to write as little code as possible), so I've put off looking at it for now. Though I am excited to look at using this in the future.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RabbitMQ was a good possibility. Marcus has already done quite a bit of work with this, but the code is a bit out of date currently. There have been several changes to the protobuf messages since Marcus originally wrote this code, and it's difficult to keep up when we change so quickly. Still, it wouldn't take much effort to get this code up-to-date and working.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Honestly, I didn't know much about Tungsten Replicator until recently. This really looks like an excellent, full-featured product. It is well thought out in its design, and seems to be fairly simple to get up and running. Then I got &lt;i&gt;really&lt;/i&gt;&amp;nbsp;excited about it when I found out that Marcus has already been working with Continuent on adding Drizzle support! Not only that, Marcus &lt;a href="https://lists.launchpad.net/drizzle-discuss/msg07172.html"&gt;announced&lt;/a&gt; his creation of a set of &lt;a href="https://launchpad.net/drizzle-java-tools"&gt;Java tools&lt;/a&gt; that contain the common code for working with the Drizzle transaction log. This can be used in his Tungsten work, as well as re-incorporated into his RabbitMQ work eventually.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It seems like a real win to work with Marcus on helping him to add Drizzle support to Tungsten, so this, along with transaction log testing, is my focus going forward. I hope to write up a simple HOWTO on using Tungsten Replicator with Drizzle once it is ready to use.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: purple;"&gt;&lt;b&gt;Looking to the Future&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;While nothing is written in stone just yet, we have multiple potential ideas for replication that are pretty exciting. Just some of them are:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Replication streams separated on a per-catalog basis. This would help to eliminate some contention issues and reduce the headaches that a single user could cause to the entire replication system.&lt;/li&gt;&lt;li&gt;Ability to limit resource usage of the slave, such as limiting concurrent writes per device.&lt;/li&gt;&lt;li&gt;Optional compression of the replication stream.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Although we have a bit of work to do, I think we have the potential to deliver some pretty interesting stuff in the future.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What other ideas would you like to see implemented in Drizzle replication?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-6466528552485488273?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/6466528552485488273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2010/10/drizzle-replication-progress-report.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/6466528552485488273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/6466528552485488273'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2010/10/drizzle-replication-progress-report.html' title='Drizzle Replication Progress Report'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-4436248939150307883</id><published>2010-08-29T17:52:00.002-04:00</published><updated>2010-09-16T09:03:42.945-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='replication'/><title type='text'>Drizzle Transaction Message Limit</title><content type='html'>Some recent changes I made have recently been pushed to Drizzle trunk that affect the size of the &lt;a href="http://www.joinfu.com/2009/10/drizzle-replication-changes-in-api-to-support-group-commit/"&gt;Transaction protobuf message&lt;/a&gt; that any replication stream will see (e.g., the &lt;a href="http://www.joinfu.com/2010/03/understanding-drizzles-transaction-log/"&gt;transaction log&lt;/a&gt;). This was necessary to fix &lt;a href="https://bugs.launchpad.net/drizzle/+bug/600795"&gt;bug 600795&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Without a Transaction message size limit, for any bulk operations, like LOAD DATA, we would have ended up with a Transaction message that could possibly contain a very large Statement message that contained all of the INSERT data for the bulk load. This obviously could eat up a large amount of memory if we kept allowing the Statement to grow without bounds. The Drizzle kernel, when it can, keeps appending the values to INSERT onto the same record.&lt;br /&gt;&lt;br /&gt;To circumvent this, we now allow multiple Transaction records for a single database transaction. Each Transaction GPB message representing a single database transaction will all have the same transaction ID, and only the last Transaction message will have the Statement's &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end_segment&lt;/span&gt; attribute set to true.&lt;br /&gt;&lt;br /&gt;Here is an example of this change that you might now see in the transaction log:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;transaction_context {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;server_id: 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;transaction_id: 3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;start_timestamp: 1283118092815781&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;end_timestamp: 1283118092815869&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;statement {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;type: INSERT&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;start_timestamp: 1283118092815782&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;end_timestamp: 1283118092815868&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;insert_header {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;table_metadata {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;schema_name: "test"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;table_name: "t"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;field_metadata {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;type: INTEGER&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;name: "id"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;field_metadata {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;type: VARCHAR&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;name: "a"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;insert_data {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;segment_id: 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;end_segment: false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;record {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "2"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "abc"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;record {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "3"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "def"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;transaction_context {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;server_id: 1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;transaction_id: 3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;start_timestamp: 1283118092816250&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;end_timestamp: 1283118092816725&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;statement {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;type: INSERT&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;start_timestamp: 1283118092816251&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;end_timestamp: 1283118092816724&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;insert_header {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;table_metadata {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;schema_name: "test"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;table_name: "t"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;field_metadata {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;type: INTEGER&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;name: "id"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;field_metadata {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;type: VARCHAR&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;name: "a"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;insert_data {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;segment_id: 1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;end_segment: true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;record {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "4"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "ghi"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;record {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "5"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;insert_value: "jkl"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;is_null: false&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This example is a bit contrived as there is no need to split up such a small transaction, but you can see the basic changes here. We have two Transaction messages, both with the same transaction ID. You can see that the Statement's &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end_segment&lt;/span&gt; is set to false in the first message, while the Statement within the second Transaction message has &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end_segment&lt;/span&gt; set to true.&lt;br /&gt;&lt;br /&gt;So, in case it isn't obvious, there are now two ways to determine when you should commit if you are a replication stream &lt;a href="http://www.joinfu.com/2009/10/drizzle-replication-changes-in-api-to-support-group-commit/"&gt;TransactionApplier&lt;/a&gt;, or if you are reading from the transaction log:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;s&gt;If the transaction ID changes, COMMIT.&lt;/s&gt;&lt;/li&gt;&lt;li&gt;Or, if the current Transaction has all Statement messages with end_segment set to true, COMMIT.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Choose which ever method of the two best suits your needs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Currently, if a Transaction message crosses the 1M threshold, the kernel will create a new Transaction message. Why did I choose 1M? Well, the &lt;a href="http://code.google.com/apis/protocolbuffers/docs/techniques.html#large-data"&gt;Google Protobuf documentation says&lt;/a&gt;:&lt;/div&gt;&lt;blockquote&gt;&lt;i&gt;Protocol Buffers are not designed to handle large messages. As a general rule of thumb, if you are dealing in messages larger than a megabyte each, it may be time to consider an alternate strategy.&lt;/i&gt;&lt;/blockquote&gt;So 1M seemed to be a reasonable default. I'll change this in the near future to be a configurable value once we get some changes to our sys var stuff merged.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-4436248939150307883?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/4436248939150307883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2010/08/drizzle-transaction-message-limit.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/4436248939150307883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/4436248939150307883'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2010/08/drizzle-transaction-message-limit.html' title='Drizzle Transaction Message Limit'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-741665898970762911</id><published>2010-08-25T11:23:00.000-04:00</published><updated>2010-08-25T11:23:42.448-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='xcode'/><title type='text'>Adding a Drizzle Executable in Xcode</title><content type='html'>In my &lt;a href="http://dshrewsbury.blogspot.com/2010/06/developing-drizzle-with-xcode.html"&gt;last post&lt;/a&gt;, I explained how to setup Drizzle under an Xcode project. This allows you to take advantage of Xcode's features while developing on Drizzle (or any other project of your own choosing). The one thing we weren't able to do was debug the Drizzle executable. This post remedies that.&lt;br /&gt;&lt;br /&gt;So it turns out that this is an easy fix. But for Drizzle, there are a few extra hoops you have to jump through in order to get it to work.&lt;br /&gt;&lt;br /&gt;The basic steps we need to do for Drizzle are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Add a custom executable in Xcode&lt;/li&gt;&lt;li&gt;Setup any arguments you want to pass to the executable&lt;/li&gt;&lt;li&gt;Setup any environment variables needed for the executable to run properly&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;For most other projects, you can probably just get away with #1 and possibly #2. For Drizzle, though, we need to do #3 so that it can find its libraries.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step #1 is easy. In the &lt;b&gt;Groups &amp;amp; Files&lt;/b&gt;&amp;nbsp;window, right click on &lt;b&gt;Executables&lt;/b&gt;&amp;nbsp;and then &lt;b&gt;Add&lt;/b&gt;&amp;nbsp;-&amp;gt; &lt;b&gt;New Custom Executable...&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_0cNc_A6-Bb8/THUwDl7nEII/AAAAAAAAABY/1TIZlb1oRAk/s1600/new_exe.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="222" src="http://1.bp.blogspot.com/_0cNc_A6-Bb8/THUwDl7nEII/AAAAAAAAABY/1TIZlb1oRAk/s320/new_exe.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will pop up a window where you define where the executable resides. Once that is done, you can define what arguments to pass it, and what environment variables should be set when it runs, among other things. These should be self explanatory, and you should be able to set this up for your particular project. For Drizzle, though, it isn't so intuitive.&lt;br /&gt;&lt;br /&gt;In Drizzle, after you run configure and make, the executable lives in a hidden directory within your &lt;i&gt;xcode-branch&lt;/i&gt; repo directory. It will actually be in:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$drizzle-repo/xcode-branch/drizzled/.libs/drizzled&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The executable you see in the &lt;i&gt;xcode-branch/drizzled&lt;/i&gt; subdirectory is actually a shell script that runs the real executable for you. Don't ask me why. So enter the path to the executable in the &lt;i&gt;.libs&lt;/i&gt; subdirectory:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_0cNc_A6-Bb8/THUzKhd2dqI/AAAAAAAAABg/Fss65MN3yCk/s1600/exe2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_0cNc_A6-Bb8/THUzKhd2dqI/AAAAAAAAABg/Fss65MN3yCk/s320/exe2.png" /&gt;&lt;/a&gt;&lt;/div&gt;Once you enter in the path and click &lt;b&gt;Finish&lt;/b&gt;, you are given the chance to edit executable working directory, arguments, environment variables etc. &amp;nbsp;The important part here is the information under the &lt;b&gt;Arguments&lt;/b&gt; tab. We need to set the arguments to the executable as well as set the DYLD_LIBRARY_PATH environment variable so that the executable can find its dynamic libraries (otherwise, it looks for them in the installation directory, which if doesn't exist yet, will cause the executable to not start). Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_0cNc_A6-Bb8/THU0jJbWM-I/AAAAAAAAABo/-gtjchFG-aQ/s1600/exe_args.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_0cNc_A6-Bb8/THU0jJbWM-I/AAAAAAAAABo/-gtjchFG-aQ/s320/exe_args.png" /&gt;&lt;/a&gt;&lt;/div&gt;Once you have this setup, you should now be able to run your executable (after you've built it, of course), and use the Xcode debugger to merrily do some bug hunting. Make sure that you have unselected the &lt;b&gt;Load symbols lazily&lt;/b&gt; option in Xcode Debugging preferences so that your breakpoints will be recognized!&lt;br /&gt;&lt;br /&gt;Happy debugging.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-741665898970762911?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/741665898970762911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2010/08/adding-drizzle-executable-in-xcode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/741665898970762911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/741665898970762911'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2010/08/adding-drizzle-executable-in-xcode.html' title='Adding a Drizzle Executable in Xcode'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_0cNc_A6-Bb8/THUwDl7nEII/AAAAAAAAABY/1TIZlb1oRAk/s72-c/new_exe.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3514705510593466065.post-5581532411326281631</id><published>2010-06-30T10:23:00.003-04:00</published><updated>2010-08-03T09:52:43.975-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drizzle'/><category scheme='http://www.blogger.com/atom/ns#' term='xcode'/><title type='text'>Developing Drizzle with Xcode</title><content type='html'>Even with all of its shortcomings, Xcode has excellent integration with the GNU debugger. It also has some good features for understanding a large code base that you may be unfamiliar with. For these reasons, I like to use Xcode for my development work. Unfortunately, it takes a bit of magic to get it setup to work with an external project that was not created specifically with/for Xcode and that does not use CVS/Subversion/Perforce.&lt;br /&gt;&lt;br /&gt;If you want to use Xcode to work on Drizzle, these are the steps you need to take to setup a project. Note that Xcode doesn't support Bazaar so you still need to do some things from the command line. (Come on, Apple. CVS and Subversion just plain suck)&lt;br /&gt;&lt;br /&gt;These instructions assume that the Drizzle repo is located in $drizzle-repo, as described &lt;a href="http://drizzle.org/wiki/Contributing_Code"&gt;here in the Drizzle wiki.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First, we need to create a new branch (we'll call it &lt;i&gt;xcode-branch&lt;/i&gt;)&amp;nbsp;of Drizzle trunk to use for our yet to be created Xcode project.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;cd $drizzle-repo&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;bzr branch trunk xcode-branch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next, we'll go into Xcode and create a new project. Choose the &lt;b&gt;External Build System&lt;/b&gt;&amp;nbsp;project. With this type of project, we'll be able to click on &lt;b&gt;Build&lt;/b&gt; to run make for us.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_0cNc_A6-Bb8/TCtHeb86lOI/AAAAAAAAAAM/OQ2u41s04pU/s1600/xcode_new_project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="342" src="http://1.bp.blogspot.com/_0cNc_A6-Bb8/TCtHeb86lOI/AAAAAAAAAAM/OQ2u41s04pU/s400/xcode_new_project.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;Click the &lt;b&gt;Choose...&lt;/b&gt;&amp;nbsp;button and save your project some place appropriate (anywhere but inside your $drizzle-repo directory). We'll tell the project where to find the source files in &lt;i&gt;xcode-branch&lt;/i&gt;&amp;nbsp;in the following steps.&lt;br /&gt;&lt;br /&gt;After saving, your project window should appear. At this point, we have no source code files in our project, so we need to tell Xcode to use our &lt;i&gt;xcode-branch&lt;/i&gt;&amp;nbsp;as the location of our source. We do that by right-clicking on our project name in the &lt;b&gt;Groups &amp;amp; Files&lt;/b&gt;&amp;nbsp;section of the project window and selecting &lt;b&gt;Add&lt;/b&gt;&amp;nbsp;-&amp;gt; &lt;b&gt;Existing Files...&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_0cNc_A6-Bb8/TCtLLsTRJtI/AAAAAAAAAAU/7pQvOF-eoQs/s1600/add_files.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://1.bp.blogspot.com/_0cNc_A6-Bb8/TCtLLsTRJtI/AAAAAAAAAAU/7pQvOF-eoQs/s400/add_files.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Navigate to your &lt;i&gt;xcode-branch&lt;/i&gt;&amp;nbsp;directory, select the directory, and click the &lt;b&gt;Add&lt;/b&gt;&amp;nbsp;button. In the window that appears, make sure that &lt;b&gt;Copy items into destination group's folder&lt;/b&gt;&amp;nbsp;option is NOT selected. We don't want to copy the source files into the Xcode project directory, we want to use them from within the Bazaar branch. We do this so that after we make changes with Xcode, we can easily open a Terminal window and commit our changes from the command line. (Again, this is because Xcode does not have Bazaar direct integration.) Also, make sure that &lt;b&gt;Recursively create groups for any added folders&lt;/b&gt;&amp;nbsp;is selected. So you should have:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_0cNc_A6-Bb8/TCtMbjK2mbI/AAAAAAAAAAc/ywgDopZwBfo/s1600/add_to_target.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/_0cNc_A6-Bb8/TCtMbjK2mbI/AAAAAAAAAAc/ywgDopZwBfo/s320/add_to_target.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Click &lt;b&gt;Add&lt;/b&gt;&amp;nbsp;and a folder for your &lt;i&gt;xcode-branch&lt;/i&gt;&amp;nbsp;should appear under your project name in the &lt;b&gt;Groups &amp;amp; Files&lt;/b&gt;&amp;nbsp;section.&lt;br /&gt;&lt;br /&gt;So what have we just done? We basically did two things here:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Created a Bazaar branch for our modifications we will make under Xcode&lt;/li&gt;&lt;li&gt;Created an Xcode project that points to our Bazaar branch.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Our working Xcode project is split up into two separate directories: one for the Xcode project files, and one for the Bazaar source files. This may seem a bit odd if you expected everything to be under a single directory, but we have to do it this way so that we can still use Bazaar commands.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is one last thing to do now. Xcode is now setup to automatically just call 'make' when we click on our &lt;b&gt;Build&lt;/b&gt;&amp;nbsp;button, but it will attempt to run 'make' in the Xcode project directory, not in our &lt;i&gt;xcode-branch&lt;/i&gt;&amp;nbsp;directory. This is an easy fix. Double-click on the target underneath&amp;nbsp;&lt;b&gt;Targets&lt;/b&gt;&amp;nbsp;in the &lt;b&gt;Groups &amp;amp; Files&lt;/b&gt;&amp;nbsp;section of the project window. This will open up the following window:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_0cNc_A6-Bb8/TCtQTIuPalI/AAAAAAAAAAk/vmG6KWxp6nU/s1600/target.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_0cNc_A6-Bb8/TCtQTIuPalI/AAAAAAAAAAk/vmG6KWxp6nU/s400/target.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Set the &lt;i&gt;Directory&lt;/i&gt;&amp;nbsp;under &lt;b&gt;Custom Build Command&lt;/b&gt;&amp;nbsp;to the location of your &lt;i&gt;xcode-branch&lt;/i&gt;. Once you do this, then clicking &lt;b&gt;Build&lt;/b&gt;&amp;nbsp;will run 'make' from within the &lt;i&gt;xcode-branch&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That's it! You can now edit the source, use Xcode features to jump to various definitions, search project files, and build the project using Command-B or the &lt;b&gt;Build&lt;/b&gt;&amp;nbsp;menu option. Obviously, you'll first have to create and run the configure script in your &lt;i&gt;xcode-branch&lt;/i&gt;&amp;nbsp;directory&amp;nbsp;by hand before you can build. And you will not be able to use the other build commands, like&amp;nbsp;&lt;b&gt;Build and Run&lt;/b&gt;, or use the debugger until you setup an executable for the project. I'll cover that in a future post.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3514705510593466065-5581532411326281631?l=dshrewsbury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dshrewsbury.blogspot.com/feeds/5581532411326281631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dshrewsbury.blogspot.com/2010/06/developing-drizzle-with-xcode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/5581532411326281631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3514705510593466065/posts/default/5581532411326281631'/><link rel='alternate' type='text/html' href='http://dshrewsbury.blogspot.com/2010/06/developing-drizzle-with-xcode.html' title='Developing Drizzle with Xcode'/><author><name>David Shrewsbury</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_0cNc_A6-Bb8/TCtHeb86lOI/AAAAAAAAAAM/OQ2u41s04pU/s72-c/xcode_new_project.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
