Merge lp://staging/~sergei.glushchenko/percona-server/ps51-bug903617 into lp://staging/percona-server/5.1

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 429
Proposed branch: lp://staging/~sergei.glushchenko/percona-server/ps51-bug903617
Merge into: lp://staging/percona-server/5.1
Diff against target: 76 lines (+37/-2)
1 file modified
Percona-Server/storage/innodb_plugin/dict/dict0dict.c (+37/-2)
To merge this branch: bzr merge lp://staging/~sergei.glushchenko/percona-server/ps51-bug903617
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+94741@code.staging.launchpad.net

Description of the change

Bug903617
Deadlock or crash on concurrent
  TRUNCATE TABLE testdb.t
and
  SELECT * FROM information_schema.tables
           WHERE table_schema="testdb" AND table_name="t"
dict_stats_latches array of RW-locks is used for locking dict
statisctics. Latch to lock is picked by table->id. TRUNCATE TABLE changes
table->id without locking any latches.
Solution is to lock the latch in exclusive mode before changing
table->id. The fact that table->id could change also taken to account
in the latch locking algorithm.

http://jenkins.percona.com/view/Percona%20Server%205.1/job/percona-server-5.1-param/275/

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Sergei,

The patch looks good to me, but please add short comments before the for loops and the call to dict_table_stats_lock() explaining why it's being done, as it may not be obvious without knowing the bug context. Please also add the upstream bug number to commit message when you have it.

review: Needs Fixing
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

> Sergei,
>
> The patch looks good to me, but please add short comments before the for loops
> and the call to dict_table_stats_lock() explaining why it's being done, as it
> may not be obvious without knowing the bug context. Please also add the
> upstream bug number to commit message when you have it.

DONE.

Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches