Archive for the ‘svn’ Category

InnoDB Revision History

Сентябрь 19th, 2010

This is a brief overview of the history of InnoDB with respect to the Version Control Systems (VCS) that were used for developing. It could be useful to people who want to trace back in time to find the origins of bugs or features.

Early days
InnoDB was born in the mid 1990s when Heikki Tuuri started developing this masterpiece. Heikki was a lone developer at that time and he did not use any VCS. There is no InnoDB revision history before 2001.

2001 – 2005
Then in 2001 InnoDB was imported into MySQL’s BitKeeper repository and development continued, recording the history there.

2005 – 2010
Later on in Oct 2005 when Oracle acquired Innobase, InnoDB developers had to move away from MySQL’s BitKeeper repository and Subversion was chosen for InnoDB development. The latest sources from BitKeeper were imported into SVN without preserving the history and Innobase started sending snapshots of InnoDB to MySQL. In other words – InnoDB devs committed changesets into SVN and then batches of those changesets were sent to MySQL. But those batches were applied as a single changeset in BitKeeper with a message like “Apply InnoDB snapshot XYZ” which made the revision history of InnoDB in BitKeeper after Oct 2005 meaningless.

In the meantime MySQL switched from BitKeeper to Bazaar, preserving all the history that BitKeeper had. This did not affect InnoDB development and revision history, except that Bazaar was easier to use than the free and limited BitKeeper client. The snapshots thing continued.

To summarize: until early 2010 InnoDB history was split in two – the before 2005 part was in Bazaar and after 2005 part was in Subversion.

2010 – present
In Mar 2010, after Oracle acquired Sun and MySQL, InnoDB development moved into Bazaar. We wanted to keep the precious history from SVN, but it was not possible to retrospectively swap the 2005-2010 history in Bazaar which contained changesets like “Apply InnoDB snapshot XYZ” with the meaningful history from Subversion. Instead, the InnoDB directory in the MySQL source tree was deleted and all revisions from SVN were applied one by one on top of the empty directory.

This way commands like “bzr blame” and “bzr log” show the relevant bits from the SVN history, up to 2005. If one wants to dive before 2005 he must branch the MySQL source as it was before the SVN import (e.g. bzr branch -rdate:2010-03-01). Branching the pre-SVN-import tree will give access to the 2001-2005 real history and 2005-2010 “apply snapshot” history.


PlanetMySQL Voting: Vote UP / Vote DOWN

InnoDB Revision History

Сентябрь 19th, 2010

This is a brief overview of the history of InnoDB with respect to the Version Control Systems (VCS) that were used for developing. It could be useful to people who want to trace back in time to find the origins of bugs or features.

Early days
InnoDB was born in the mid 1990s when Heikki Tuuri started developing this masterpiece. Heikki was a lone developer at that time and he did not use any VCS. There is no InnoDB revision history before 2001.

2001 – 2005
Then in 2001 InnoDB was imported into MySQL’s BitKeeper repository and development continued, recording the history there.

2005 – 2010
Later on in Oct 2005 when Oracle acquired Innobase, InnoDB developers had to move away from MySQL’s BitKeeper repository and Subversion was chosen for InnoDB development. The latest sources from BitKeeper were imported into SVN without preserving the history and Innobase started sending snapshots of InnoDB to MySQL. In other words – InnoDB devs committed changesets into SVN and then batches of those changesets were sent to MySQL. But those batches were applied as a single changeset in BitKeeper with a message like “Apply InnoDB snapshot XYZ” which made the revision history of InnoDB in BitKeeper after Oct 2005 meaningless.

In the meantime MySQL switched from BitKeeper to Bazaar, preserving all the history that BitKeeper had. This did not affect InnoDB development and revision history, except that Bazaar was easier to use than the free and limited BitKeeper client. The snapshots thing continued.

To summarize: until early 2010 InnoDB history was split in two – the before 2005 part was in Bazaar and after 2005 part was in Subversion.

2010 – present
In Mar 2010, after Oracle acquired Sun and MySQL, InnoDB development moved into Bazaar. We wanted to keep the precious history from SVN, but it was not possible to retrospectively swap the 2005-2010 history in Bazaar which contained changesets like “Apply InnoDB snapshot XYZ” with the meaningful history from Subversion. Instead, the InnoDB directory in the MySQL source tree was deleted and all revisions from SVN were applied one by one on top of the empty directory.

This way commands like “bzr blame” and “bzr log” show the relevant bits from the SVN history, up to 2005. If one wants to dive before 2005 he must branch the MySQL source as it was before the SVN import (e.g. bzr branch -rdate:2010-03-01). Branching the pre-SVN-import tree will give access to the 2001-2005 real history and 2005-2010 “apply snapshot” history.


PlanetMySQL Voting: Vote UP / Vote DOWN

InnoDB Revision History

Сентябрь 19th, 2010

This is a brief overview of the history of InnoDB with respect to the Version Control Systems (VCS) that were used for developing. It could be useful to people who want to trace back in time to find the origins of bugs or features.

Early days
InnoDB was born in the mid 1990s when Heikki Tuuri started developing this masterpiece. Heikki was a lone developer at that time and he did not use any VCS. There is no InnoDB revision history before 2001.

2001 – 2005
Then in 2001 InnoDB was imported into MySQL’s BitKeeper repository and development continued, recording the history there.

2005 – 2010
Later on in Oct 2005 when Oracle acquired Innobase, InnoDB developers had to move away from MySQL’s BitKeeper repository and Subversion was chosen for InnoDB development. The latest sources from BitKeeper were imported into SVN without preserving the history and Innobase started sending snapshots of InnoDB to MySQL. In other words – InnoDB devs committed changesets into SVN and then batches of those changesets were sent to MySQL. But those batches were applied as a single changeset in BitKeeper with a message like “Apply InnoDB snapshot XYZ” which made the revision history of InnoDB in BitKeeper after Oct 2005 meaningless.

In the meantime MySQL switched from BitKeeper to Bazaar, preserving all the history that BitKeeper had. This did not affect InnoDB development and revision history, except that Bazaar was easier to use than the free and limited BitKeeper client. The snapshots thing continued.

To summarize: until early 2010 InnoDB history was split in two – the before 2005 part was in Bazaar and after 2005 part was in Subversion.

2010 – present
In Mar 2010, after Oracle acquired Sun and MySQL, InnoDB development moved into Bazaar. We wanted to keep the precious history from SVN, but it was not possible to retrospectively swap the 2005-2010 history in Bazaar which contained changesets like “Apply InnoDB snapshot XYZ” with the meaningful history from Subversion. Instead, the InnoDB directory in the MySQL source tree was deleted and all revisions from SVN were applied one by one on top of the empty directory.

This way commands like “bzr blame” and “bzr log” show the relevant bits from the SVN history, up to 2005. If one wants to dive before 2005 he must branch the MySQL source as it was before the SVN import (e.g. bzr branch -rdate:2010-03-01). Branching the pre-SVN-import tree will give access to the 2001-2005 real history and 2005-2010 “apply snapshot” history.


PlanetMySQL Voting: Vote UP / Vote DOWN

InnoDB Revision History

Сентябрь 19th, 2010

This is a brief overview of the history of InnoDB with respect to the Version Control Systems (VCS) that were used for developing. It could be useful to people who want to trace back in time to find the origins of bugs or features.

Early days
InnoDB was born in the mid 1990s when Heikki Tuuri started developing this masterpiece. Heikki was a lone developer at that time and he did not use any VCS. There is no InnoDB revision history before 2001.

2001 – 2005
Then in 2001 InnoDB was imported into MySQL’s BitKeeper repository and development continued, recording the history there.

2005 – 2010
Later on in Oct 2005 when Oracle acquired Innobase, InnoDB developers had to move away from MySQL’s BitKeeper repository and Subversion was chosen for InnoDB development. The latest sources from BitKeeper were imported into SVN without preserving the history and Innobase started sending snapshots of InnoDB to MySQL. In other words – InnoDB devs committed changesets into SVN and then batches of those changesets were sent to MySQL. But those batches were applied as a single changeset in BitKeeper with a message like “Apply InnoDB snapshot XYZ” which made the revision history of InnoDB in BitKeeper after Oct 2005 meaningless.

In the meantime MySQL switched from BitKeeper to Bazaar, preserving all the history that BitKeeper had. This did not affect InnoDB development and revision history, except that Bazaar was easier to use than the free and limited BitKeeper client. The snapshots thing continued.

To summarize: until early 2010 InnoDB history was split in two – the before 2005 part was in Bazaar and after 2005 part was in Subversion.

2010 – present
In Mar 2010, after Oracle acquired Sun and MySQL, InnoDB development moved into Bazaar. We wanted to keep the precious history from SVN, but it was not possible to retrospectively swap the 2005-2010 history in Bazaar which contained changesets like “Apply InnoDB snapshot XYZ” with the meaningful history from Subversion. Instead, the InnoDB directory in the MySQL source tree was deleted and all revisions from SVN were applied one by one on top of the empty directory.

This way commands like “bzr blame” and “bzr log” show the relevant bits from the SVN history, up to 2005. If one wants to dive before 2005 he must branch the MySQL source as it was before the SVN import (e.g. bzr branch -rdate:2010-03-01). Branching the pre-SVN-import tree will give access to the 2001-2005 real history and 2005-2010 “apply snapshot” history.


PlanetMySQL Voting: Vote UP / Vote DOWN

InnoDB Revision History

Сентябрь 19th, 2010

This is a brief overview of the history of InnoDB with respect to the Version Control Systems (VCS) that were used for developing. It could be useful to people who want to trace back in time to find the origins of bugs or features.

Early days
InnoDB was born in the mid 1990s when Heikki Tuuri started developing this masterpiece. Heikki was a lone developer at that time and he did not use any VCS. There is no InnoDB revision history before 2001.

2001 – 2005
Then in 2001 InnoDB was imported into MySQL’s BitKeeper repository and development continued, recording the history there.

2005 – 2010
Later on in Oct 2005 when Oracle acquired Innobase, InnoDB developers had to move away from MySQL’s BitKeeper repository and Subversion was chosen for InnoDB development. The latest sources from BitKeeper were imported into SVN without preserving the history and Innobase started sending snapshots of InnoDB to MySQL. In other words – InnoDB devs committed changesets into SVN and then batches of those changesets were sent to MySQL. But those batches were applied as a single changeset in BitKeeper with a message like “Apply InnoDB snapshot XYZ” which made the revision history of InnoDB in BitKeeper after Oct 2005 meaningless.

In the meantime MySQL switched from BitKeeper to Bazaar, preserving all the history that BitKeeper had. This did not affect InnoDB development and revision history, except that Bazaar was easier to use than the free and limited BitKeeper client. The snapshots thing continued.

To summarize: until early 2010 InnoDB history was split in two – the before 2005 part was in Bazaar and after 2005 part was in Subversion.

2010 – present
In Mar 2010, after Oracle acquired Sun and MySQL, InnoDB development moved into Bazaar. We wanted to keep the precious history from SVN, but it was not possible to retrospectively swap the 2005-2010 history in Bazaar which contained changesets like “Apply InnoDB snapshot XYZ” with the meaningful history from Subversion. Instead, the InnoDB directory in the MySQL source tree was deleted and all revisions from SVN were applied one by one on top of the empty directory.

This way commands like “bzr blame” and “bzr log” show the relevant bits from the SVN history, up to 2005. If one wants to dive before 2005 he must branch the MySQL source as it was before the SVN import (e.g. bzr branch -rdate:2010-03-01). Branching the pre-SVN-import tree will give access to the 2001-2005 real history and 2005-2010 “apply snapshot” history.


PlanetMySQL Voting: Vote UP / Vote DOWN

InnoDB Revision History

Сентябрь 19th, 2010

This is a brief overview of the history of InnoDB with respect to the Version Control Systems (VCS) that were used for developing. It could be useful to people who want to trace back in time to find the origins of bugs or features.

Early days
InnoDB was born in the mid 1990s when Heikki Tuuri started developing this masterpiece. Heikki was a lone developer at that time and he did not use any VCS. There is no InnoDB revision history before 2001.

2001 – 2005
Then in 2001 InnoDB was imported into MySQL’s BitKeeper repository and development continued, recording the history there.

2005 – 2010
Later on in Oct 2005 when Oracle acquired Innobase, InnoDB developers had to move away from MySQL’s BitKeeper repository and Subversion was chosen for InnoDB development. The latest sources from BitKeeper were imported into SVN without preserving the history and Innobase started sending snapshots of InnoDB to MySQL. In other words – InnoDB devs committed changesets into SVN and then batches of those changesets were sent to MySQL. But those batches were applied as a single changeset in BitKeeper with a message like “Apply InnoDB snapshot XYZ” which made the revision history of InnoDB in BitKeeper after Oct 2005 meaningless.

In the meantime MySQL switched from BitKeeper to Bazaar, preserving all the history that BitKeeper had. This did not affect InnoDB development and revision history, except that Bazaar was easier to use than the free and limited BitKeeper client. The snapshots thing continued.

To summarize: until early 2010 InnoDB history was split in two – the before 2005 part was in Bazaar and after 2005 part was in Subversion.

2010 – present
In Mar 2010, after Oracle acquired Sun and MySQL, InnoDB development moved into Bazaar. We wanted to keep the precious history from SVN, but it was not possible to retrospectively swap the 2005-2010 history in Bazaar which contained changesets like “Apply InnoDB snapshot XYZ” with the meaningful history from Subversion. Instead, the InnoDB directory in the MySQL source tree was deleted and all revisions from SVN were applied one by one on top of the empty directory.

This way commands like “bzr blame” and “bzr log” show the relevant bits from the SVN history, up to 2005. If one wants to dive before 2005 he must branch the MySQL source as it was before the SVN import (e.g. bzr branch -rdate:2010-03-01). Branching the pre-SVN-import tree will give access to the 2001-2005 real history and 2005-2010 “apply snapshot” history.


PlanetMySQL Voting: Vote UP / Vote DOWN

InnoDB Revision History

Сентябрь 19th, 2010

This is a brief overview of the history of InnoDB with respect to the Version Control Systems (VCS) that were used for developing. It could be useful to people who want to trace back in time to find the origins of bugs or features.

Early days
InnoDB was born in the mid 1990s when Heikki Tuuri started developing this masterpiece. Heikki was a lone developer at that time and he did not use any VCS. There is no InnoDB revision history before 2001.

2001 – 2005
Then in 2001 InnoDB was imported into MySQL’s BitKeeper repository and development continued, recording the history there.

2005 – 2010
Later on in Oct 2005 when Oracle acquired Innobase, InnoDB developers had to move away from MySQL’s BitKeeper repository and Subversion was chosen for InnoDB development. The latest sources from BitKeeper were imported into SVN without preserving the history and Innobase started sending snapshots of InnoDB to MySQL. In other words – InnoDB devs committed changesets into SVN and then batches of those changesets were sent to MySQL. But those batches were applied as a single changeset in BitKeeper with a message like “Apply InnoDB snapshot XYZ” which made the revision history of InnoDB in BitKeeper after Oct 2005 meaningless.

In the meantime MySQL switched from BitKeeper to Bazaar, preserving all the history that BitKeeper had. This did not affect InnoDB development and revision history, except that Bazaar was easier to use than the free and limited BitKeeper client. The snapshots thing continued.

To summarize: until early 2010 InnoDB history was split in two – the before 2005 part was in Bazaar and after 2005 part was in Subversion.

2010 – present
In Mar 2010, after Oracle acquired Sun and MySQL, InnoDB development moved into Bazaar. We wanted to keep the precious history from SVN, but it was not possible to retrospectively swap the 2005-2010 history in Bazaar which contained changesets like “Apply InnoDB snapshot XYZ” with the meaningful history from Subversion. Instead, the InnoDB directory in the MySQL source tree was deleted and all revisions from SVN were applied one by one on top of the empty directory.

This way commands like “bzr blame” and “bzr log” show the relevant bits from the SVN history, up to 2005. If one wants to dive before 2005 he must branch the MySQL source as it was before the SVN import (e.g. bzr branch -rdate:2010-03-01). Branching the pre-SVN-import tree will give access to the 2001-2005 real history and 2005-2010 “apply snapshot” history.


PlanetMySQL Voting: Vote UP / Vote DOWN

DevOps at dealnews.com

Апрель 5th, 2010
I was telling someone how we roll changes to production at dealnews and they seemed really amazed by it. I have never really thought it was that impressive. It just made sense. It has kind of happened organically here over the years. Anyhow, I thought I would share.

Version Control

So, to start with, everything is in SVN. PHP code, Apache configs, DNS and even the scripts we use to deploy code. That is huge. We even have a misc directory in SVN where we put any useful scripts we use on our laptops for managing our code base. Everyone can share that way. Everyone can see what changed when. We can roll things back, branch if we need to, etc. I don't know how anyone lives with out. We did way back when. It was bad. People were stepping on each other. It was a mess. We quickly decided it did not work.

For our PHP code, we have trunk and a production branch. There are also a couple of developers (me) that like to have their own branch because they break things for weeks at a time. But, everything goes into trunk from my branch before going into production. We have a PHP script that can merge from a developer branch into trunk with conflict resolution assistance built in. It is also capable of merging changes from trunk back into a branch. Once it is in trunk we use our staging environment to put it into production.

Staging/Testing

Everything has a staging point. For our PHP code, it is a set of test staging servers in our home office that have a checkout of the production branch. To roll code, the developer working on the project logs in via ssh to a staging server as a restricted user and uses a tool we created that is similar to the Python based svnmerge.py. Ours is written in PHP and tailored for our directory structure and roll out procedures. It also runs php -l on all .php and .html files as a last check for any errors. Once the merge is clean, the developer(s) use the staging servers just as they would our public web site. The database on the staging server is updated nightly from production. It is as close to a production view of our site as you can get without being on production. Assuming the application performs as expected, the developer uses the merge tool to commit the changes to the production branch. They then use the production staging servers to deploy.

Rolling to Production

For deploying code and hands on configuration changes into our production systems, we have a staging server in our primary data center. The developer (that is key IMO) logs in to the production staging servers, as a restricted user, and uses our Makefile to update the checkout and rsync the changes to the servers. Each different configuration environment has an accompanying nodes file that lists the servers that are to receive code from the checkout. This ensures that code is rolled to servers in the correct order. If an application server gets new markup before the supporting CSS or images are loaded onto the CDN source servers, you can get an ugly page. The Makefile is also capable of copying files to a single node. We will often do this for big changes. We can remove a node from service, check code out to it, and via VPN access that server directly to review how the changes worked.

For some services (cron, syslog, ssh, snmp and ntp) we use Puppet to manage configuration and to ensure the packages are installed. Puppet and Gentoo get along great. If someone mistakenly uninstalls cron, Puppet will put it back for us. (I don't know how that could happen, but ya never know). We hope to deploy more and more Puppet as we get comfortable with it.

Keeping Everyone in the Loop

Having everyone know what is going on is important. To do that, we start with Trac for ticketing. Secondly, we use OpenFire XMPP server throughout the company. The devops team has a channel that everyone is in all day. When someone rolls code to production, the scripts mentioned above that sync code out to the servers sends a message via an XMPP bot that we wrote using Ruby (Ruby has the best multi-user chat libraries for XMPP). It interfaces with Trac via HTTP and tells everyone what changesets were just rolled and who committed them. So, in 5 minutes if something breaks, we can go back and look at what just rolled.

In addition to bots telling us things, there is a cultural requirement. Often before a big roll out, we will discuss it in chat. That is the part than can not be scripted or programmed. You have to get your developers and operations talking to each other about things.

Final Thoughts

There are some subtle concepts in this post that may not be clear. One is that the code that is written on a development server is the exact same code that is used on a production server. It is not massaged in any way. Things like database server names, passwords, etc. are all kept in configuration files on each node. They are tailored for the data center that server lives in. Another I want to point out again is that the person that wrote the code is responsible all the way through to production. While at first this may make some developers nervous, it eventually gives them a sense of ownership. Of course, we don't hire someone off the street and give them that access.  But it is expected that all developers will have that responsibility eventually.
PlanetMySQL Voting: Vote UP / Vote DOWN