Bug #47016 rpl_do_grant fails on PB-2 with a failing connect
Submitted: 31 Aug 2009 11:47 Modified: 19 Dec 2009 11:16
Reporter: Andrei Elkin Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Luis Soares CPU Architecture:Any
Tags: pb-2, test failure

[31 Aug 2009 11:47] Andrei Elkin
Description:
http://pb2.norway.sun.com/web.py?template=mysql_show_test_failure&test_failure_id=2297708

shows

Where 	Build 	Test 	Run 	Suite 	Case 	Mode 	When
mysql-5.1-bugteam
509462	tree-max-win-x86_64-zip
509484 loki03	test-max-win_ws2008-x86_64
509544 loki05	rpl_binlog_row	rpl	rpl_do_grant	None	2009-08-31 04:52:57
- Show/hide test output -
Original output

rpl.rpl_do_grant                         [ fail ]
        Test ended at 2009-08-31 07:43:45

CURRENT_TEST: rpl.rpl_do_grant
mysqltest: At line 133: query 'connect  create_rout_db_slave, localhost, create_rout_db, create_rout_db, bug42217_db, $SLAVE_MYPORT,' failed: 1045: Access denied for user 'create_rout_db'@'localhost' (using password: YES)

The result from queries just before the failure was:
< snip >
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
revoke all privileges, grant option from rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
drop user rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
DROP DATABASE IF EXISTS bug42217_db;
CREATE DATABASE  bug42217_db;
GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
        IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION;

More results from queries before failure can be found in G:\pb2\test\sb_1-720412-1251688683.84\mysql-5.1.39-win-x86_64-test\mysql-test\var\log\rpl_do_grant.log

 - saving 'G:/pb2/test/sb_1-720412-1251688683.84/mysql-5.1.39-win-x86_64-test/mysql-test/var/log/rpl.rpl_do_grant/' to 'G:/pb2/test/sb_1-720412-1251688683.84/mysql-5.1.39-win-x86_64-test/mysql-test/var/log/rpl.rpl_do_grant/'

How to repeat:
Look at PB-2 logs.
[9 Sep 2009 16:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/82846

3110 Luis Soares	2009-09-09
      BUG#47016: rpl_do_grant fails on PB-2 with a failing connect
      
      The test case rpl_do_grant fails sporadically on PB2 with "Access
      denied for user 'create_rout_db'@'localhost' ...". Inspecting the
      test case, one may find that if issues a GRANT on the master
      connection and immediately after it creates two new connections
      (one to the master and one to the slave) using the credentials
      set with the GRANT.
      
      Unfortunately, there is no synchronization between master and
      slave after the grant and before the connections are
      established. This can result in slave not having executed the
      GRANT by the time the connection is attempted.
      
      This patch fixes this by deploying a sync_slave_with_master
      between the grant and the connections attempt.
[13 Sep 2009 21:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/83126

3123 Luis Soares	2009-09-13
      BUG#47016: rpl_do_grant fails on PB-2 with a failing connect
            
      The test case rpl_do_grant fails sporadically on PB2 with "Access
      denied for user 'create_rout_db'@'localhost' ...". Inspecting the
      test case, one may find that if issues a GRANT on the master
      connection and immediately after it creates two new connections
      (one to the master and one to the slave) using the credentials
      set with the GRANT.
            
      Unfortunately, there is no synchronization between master and
      slave after the grant and before the connections are
      established. This can result in slave not having executed the
      GRANT by the time the connection is attempted.
            
      This patch fixes this by deploying a sync_slave_with_master
      between the grant and the connections attempt.
[13 Sep 2009 21:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/83127

3604 Luis Soares	2009-09-13 [merge]
      BUG#47016: merge: mysql-5.1-bugteam --> mysql-pe
[13 Sep 2009 21:58] Luis Soares
Queued in mysql-5.1-bugteam and mysql-pe.
[14 Sep 2009 16:04] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (version source revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (merge vers: 5.4.4-alpha) (pib:11)
[15 Sep 2009 7:29] Jon Stephens
Test failure only; no user-facing changes to document; closer without further action.
[6 Oct 2009 9:00] Bugs System
Pushed into 5.1.40 (revid:joro@sun.com-20091006073316-lea2cpijh9r6on7c) (version source revid:ingo.struewing@sun.com-20090916070128-6053el2ucp5z7pyn) (merge vers: 5.1.39) (pib:11)
[18 Dec 2009 10:40] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:56] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:10] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:24] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[19 Dec 2009 11:16] Jon Stephens
Setting back to Closed state. See my previous comments.