Merge lp:~stewart/drizzle/slap-remove-autocommit-in-load-bug668143 into lp:drizzle/7.0

Proposed by Stewart Smith
Status: Merged
Approved by: Brian Aker
Approved revision: 1885
Merged at revision: 1911
Proposed branch: lp:~stewart/drizzle/slap-remove-autocommit-in-load-bug668143
Merge into: lp:drizzle/7.0
Diff against target: 59 lines (+0/-8)
3 files modified
client/drizzleslap.cc (+0/-4)
plugin/haildb/tests/r/drizzleslap.result (+0/-2)
tests/r/drizzleslap.result (+0/-2)
To merge this branch: bzr merge lp:~stewart/drizzle/slap-remove-autocommit-in-load-bug668143
Reviewer Review Type Date Requested Status
Brian Aker Needs Fixing
Lee Bieber (community) Needs Fixing
Review via email: mp+39598@code.launchpad.net

Description of the change

At the end of the first iteration in drizzleslap, if commit_count is set, it will run SET AUTOCOMMIT=0. This means that the next load of data for the next iteration gets run in 1 transaction.

On top of this, it is a transaction that is NOT committed.

i.e. the second iteration will be running against no data.

this patch fixes that.

To post a comment you must log in.
1880. By Stewart Smith

fix drizzleslap test results so that the autocommit isn't in the log of queries run

Revision history for this message
Brian Aker (brianaker) wrote :

Just looking at the patch, you only removed part of the feature, not the entire thing.

Looking at this, I think it might be better to just fix it to work, instead of pulling it out (which I know is counter to what I thought on IRC, but I hadn't looked at the code at that point).

Revision history for this message
Brian Aker (brianaker) wrote :

I'm looking at the test cases, and I see where we do test that commit is called.

So what query do you need to run to see that commit isn't happening? (--only-print will allow you to create a log BTW).

Revision history for this message
Brian Aker (brianaker) wrote :

--exec $DRIZZLE_SLAP --only-print --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --auto-generate-sql-load-type=update --auto-generate-sql-execute-number=5 --commit=1

The above when added to the test case shows commit being called for each update.

Revision history for this message
Stewart Smith (stewart) wrote :

the missing commit is for the connection that does CREATE TABLE and loads the data. COMMIT is being called correctly for all the connections/threads for load generation - it's just that on the second iteration of create table/load data, (without this patch) we run the load in a transaction that isn't committed.

1881. By Stewart Smith

merge trunk

1882. By Stewart Smith

merge drizzleslap displaying connection ids in --only-print

1883. By Stewart Smith

update drizzleslap test results for fixing autocommit=0 being present in connection that loads data

1884. By Stewart Smith

merge drizzleslap client test

1885. By Stewart Smith

merge trunk and drizzleslap solaris compiler warning fixes

Revision history for this message
Lee Bieber (kalebral-deactivatedaccount) wrote :
review: Needs Fixing
1886. By Stewart Smith

merge fixes

Revision history for this message
Lee Bieber (kalebral-deactivatedaccount) wrote :

Valgrind build fail on both 32bit and 64bit runs. drizzleslap test fails

review: Needs Fixing
Revision history for this message
Brian Aker (brianaker) wrote :

Here is the issues:
==14717== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
==14717==    at 0x6BF2C0E: __libc_sigaction (sigaction.c:67)
==14717==    by 0x4E33E41: drizzle_create (drizzle.c:73)
==14717==    by 0x41DD20: main (drizzletest.cc:5678)
==14717==  Address 0x7feffd888 is on thread 1's stack
==14717==

Why not use a boost thread ptr to store the value instead?

review: Needs Fixing
Revision history for this message
Stewart Smith (stewart) wrote :

how do I even possibly trip that up.... in drizzletest?

Revision history for this message
Stewart Smith (stewart) wrote :

I've been completely unable to reproduce this failure - even orisndriz08.

My guess is that something went awry on the machines during this run?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/drizzleslap.cc'
2--- client/drizzleslap.cc 2010-11-04 01:18:44 +0000
3+++ client/drizzleslap.cc 2010-11-04 22:58:43 +0000
4@@ -767,15 +767,11 @@
5 if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)
6 generate_primary_key_list(con, eptr);
7
8- if (commit_rate)
9- run_query(con, NULL, "SET AUTOCOMMIT=0", strlen("SET AUTOCOMMIT=0"));
10-
11 if (not pre_system.empty())
12 {
13 int ret= system(pre_system.c_str());
14 assert(ret != -1);
15 }
16-
17
18 /*
19 Pre statements are always run after all other logic so they can
20
21=== modified file 'plugin/haildb/tests/r/drizzleslap.result'
22--- plugin/haildb/tests/r/drizzleslap.result 2010-11-01 04:41:48 +0000
23+++ plugin/haildb/tests/r/drizzleslap.result 2010-11-04 22:58:43 +0000
24@@ -175,7 +175,6 @@
25 /* CON: 0 */ create table t2(foo1 varchar(32), foo2 varchar(32));
26 /* CON: 0 */ INSERT INTO t1 VALUES (1, 'This is a test');
27 /* CON: 0 */ insert into t2 values ('test', 'test2');
28-/* CON: 0 */ SET AUTOCOMMIT=0;
29 /* CON: 0 */ SHOW TABLES;
30 /* CON: 1 */ SET AUTOCOMMIT=0;
31 /* CON: 1 */ select * from t1;
32@@ -201,7 +200,6 @@
33 /* CON: 0 */ create table t2(foo1 varchar(32), foo2 varchar(32));
34 /* CON: 0 */ INSERT INTO t1 VALUES (1, 'This is a test');
35 /* CON: 0 */ insert into t2 values ('test', 'test2');
36-/* CON: 0 */ SET AUTOCOMMIT=0;
37 /* CON: 0 */ SHOW TABLES;
38 /* CON: 2 */ SET AUTOCOMMIT=0;
39 /* CON: 2 */ select * from t1;
40
41=== modified file 'tests/r/drizzleslap.result'
42--- tests/r/drizzleslap.result 2010-11-01 04:41:48 +0000
43+++ tests/r/drizzleslap.result 2010-11-04 22:58:43 +0000
44@@ -175,7 +175,6 @@
45 /* CON: 0 */ create table t2(foo1 varchar(32), foo2 varchar(32));
46 /* CON: 0 */ INSERT INTO t1 VALUES (1, 'This is a test');
47 /* CON: 0 */ insert into t2 values ('test', 'test2');
48-/* CON: 0 */ SET AUTOCOMMIT=0;
49 /* CON: 0 */ SHOW TABLES;
50 /* CON: 1 */ SET AUTOCOMMIT=0;
51 /* CON: 1 */ select * from t1;
52@@ -201,7 +200,6 @@
53 /* CON: 0 */ create table t2(foo1 varchar(32), foo2 varchar(32));
54 /* CON: 0 */ INSERT INTO t1 VALUES (1, 'This is a test');
55 /* CON: 0 */ insert into t2 values ('test', 'test2');
56-/* CON: 0 */ SET AUTOCOMMIT=0;
57 /* CON: 0 */ SHOW TABLES;
58 /* CON: 2 */ SET AUTOCOMMIT=0;
59 /* CON: 2 */ select * from t1;

Subscribers

People subscribed via source and target branches