Showing entries 33516 to 33525 of 44832
« 10 Newer Entries | 10 Older Entries »
ALTER TABLE flakiness and mysql replication

Over the past few years of dealing with mysql in larger environments, one thing I’ve always felt that ALTER TABLE statements are flaky with replication, but could never really prove it. I never had a chance to dig into some of strange things I saw, and would tend to overlook and fix them

While working for a client, I encountered an issue that I could no longer ignore. In order to reload a small table from a master database to a number of slaves, I simply piped the output of mysqldump into the master and expected everything to flow into the slaves.

The bug is very specific, and probably not very common. If you send a statement like below, as mysqldump automatically adds, to your master:

/*!40000 ALTER TABLE table_name DISABLE KEYS */;

and have configured something like

replicate-rewrite-db=mydb->mydb_slave

on …

[Read more]
Apache PHP MySQL and Runaway Scripts

Sometimes due to programming error or due to very complex query you can get your PHP script running too long, well after user stopped waiting for the page to render and went browsing other sites.
Looking at Server-Status I've seen scripts executing for hours sometimes which is obviously the problem - they take Apache Slot, MySQL Connection and other resources.

I had discussion today who was thinking Apache would kill the script after "Timeout" specified in Apache configuration is reached - this was not my experience so I decided to run couple of tests to check it.

I wrote couple of very simple scripts which demonstrate different behavior for scripts running very long time. For simplicity I did not use MySQL, but other system call - sleep() which has similar behavior for sake of experiment:

Script which simply runs in tight loop "forever"

PLAIN TEXT PHP:

[Read more]
Dangerous command

Remembering that I did RENAME DATABASE in MySQL 5.1.21 and found it useful I tried it with 5.1.24 (I was playing with 20GB InnoDB database, so dumping is not fastest way) and all my tries finished with "Syntax error".
So RTMF and documentation says
"This statement was added in MySQL 5.1.7 but was found to be dangerous and was removed in MySQL 5.1.23."

For me term 'dangerous' is interesting there , as I'd expect really dangerous is DROP DATABASE (which I hope will not be removed in next release) , and RENAME DATABASE is supposed to be kind of safe - just replaces old name to new one.

I guess there are some related bugs - and there are:
Bug#28360: RENAME DATABASE destroys routines
Bug#17565:

[Read more]
How to cause deadlocks in INNODB and fix them

So imagine you have a table and for every row it contains an INT that represents a user, a medium int that represents an activity number, and a ENUM that represents state.



CREATE TABLE UserStack (
id int unsigned not null default 0,
activity medium int unsigned not null default 0,
state ENUM('ready','processing','processed', 'error'),
PRIMARY KEY(id),
INDEX (state, activity)
) ENGINE = INNODB;




Now you have an application that is spread across many servers which pops a set of users off the stack and sets them to a processing state.



START TRANSACTION

SELECT * FROM UserStack WHERE state='ready' ORDER BY activity DESC LIMIT 10 FOR UPDATE

foreach id

Mark them Processing





If multiple threads do this at the same time; the 1st thread will …

[Read more]
I moved this blog to pairLite with zero downtime, and it was easy

Did you notice that I moved this blog from pair Networks to pairLite hosting? Probably not, unless you check the DNS of xaprb.com regularly! Don’t you hate it when people say “I’m moving my blog, I hope there won’t be more than a few days of downtime, blah blah…” Why is this ever necessary, I wonder? I wonder the same thing about a lot of hosting providers – recently I had a client in my consulting practice whose (very large, well-known) hosting provider tried to help them with some very simple MySQL work and ended up causing them an obscene amount of downtime, like many many days, and there was no end in sight.

Variable's Day Out #13: binlog_format

Properties:

Applicable To MySQL Server
Introduced In 5.1.5
Server Startup Option --binlog-format=<value>
Scope Both
Dynamic Yes
Possible Values enum(ROW, STATEMENT, MIXED)
Default < 5.1.12: STATEMENT
>= 5.1.12: MIXED
Categories Replication, Performance

Description:

Starting with 5.1.5, MySQL has implemented ROW based replication format which logs the physical …

[Read more]
iTunes I do not like your xml!

This isn’t mysql related yet, but it will be. It’s the first step in writing my own itunes xml parser so that I can put all of my xml information into a database for other relational processing.

I was needing to copy my songs to a GPS device that I use on my motorcycle (it plays mp3s too). And since I didn’t want to burn a cd and then rip the tracks back to my GPS, I figured I’d export the playlist as XML and then initiate some awk/sed to clean the xml data, then scp the files from the music server to my sd card.

The code!

#!/bin/sh
cat inputfile.xml |grep "Location” | awk -F “” {’print $2′} | sed ’s/<\/string>//g’| sed ’s/\%20/\\\\ /g’ | sed ’s/file:\/\/localhost//g’ | while read line; do
echo $line
scp media@192.168.0.103:”$line” TO_GARMIN/
done

Which, after encountering some badly named files from iTunes ripping… the …

[Read more]
MySQL and Kickfire Break Records (Again)

Following on from the announcement at the MySQL conference where Sun and Kickfire jointly announced data warehousing benchmark records, we have just announced new TPC-H benchmark records. Specifically, the Kickfire Database Appliance 2400 is the highest price/performance offering at 300GB, again breaking the $1 barrier for the first time coming in at 89 cents per QphH (Queries per hour on the TPC-H benchmark). The 2400 is also the highest performance (non-clustered) offering at 300GB.

I’m not going to further dwell on the numbers in this post other than to quickly point out another aspect of this achievement that Justin noted in his blog related to the energy savings the Kickfire …

[Read more]
wl3600++ complete

I've coded and pushed wl3600++ to telco-6.4
- lots of code simplification
- lots of "duplicate" code removal

Also merged it into table-reorg clone.
And now system restart just started magically working.
So I can again run mysql-test-run

Will now fix any problems found by mysql-test-run.pl

---

Q4M version 0.5.1 released

I have just released version 0.5.1 of Q4M, a message queue that acts as a pluggable storage engine of MySQL. In the release, I have fixed two bugs that might that might block table compaction from occuring, or cause a return of an empty result set when data exists. Thanks to Brian for pointing them out.

Q4M Hogepage

PS. If you have installation problems, using the svn version might help. Installation problems in 0.5.1 have been fixed (link error on linux/x86_64 and installation directory problem with binary distribution of mysql).

Showing entries 33516 to 33525 of 44832
« 10 Newer Entries | 10 Older Entries »