Port fake changes fix for MTS from the Facebook patch

Bug #1204435 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Expired
Medium
Unassigned
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Expired
Medium
Unassigned

Bug Description

Facebook patch has the following bit at the start of row_ins_sec_index_entry_by_modify():

    /* Another exception here is when sql thread updates the delete
    marked node and unmarks it before the faker thread got here.
    This can happen with multi threaded slave and when faker thread
    tries to update the same secondary index node as that of sql slave
    worker. */
    trx_t* trx=thr_get_trx(thr);
    if (trx->fake_changes)
      return(DB_SUCCESS);

It does not have a corresponding MTR testcase. Port this bit and look into creating a corresponding testcase.

tags: added: fake-changes xtradb
Revision history for this message
Roel Van de Paar (roel11) wrote :

Could this be the cause of some of the fake changes bugs we've been seeing?

tags: added: 56qual maybe
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Yes, might be related to 1 or 2 crashes we have seen. Which is good, as non-MTS testcase is then possible.

tags: removed: 56qual maybe
Revision history for this message
Krunal Bauskar (krunal-bauskar) wrote :

From the comment is sounds like

sql-thread:
* try to update something ... causes delete-mark of the record ...

fetcher thread (running with fake-change mode-on)
* try to update same record .. found that the record is delete mark and so opt for row_ins_sec_index_entry_by_modify() but before it could go ahead slave thread trx is rolled back and so the delete-marked record is reset back to non-delete-marked.

* When the row_ins_sec_index_entry_by_modify() .. resumes things will crash as record is not more delete-marked.

---------

How is this protected in normal mode:
- Any other thread running in normal mode will have to wait for first sql-thread to release latch. sql-thread takes X-LATCH on the leaf page if mode = BTR_MODIFY_LEAF.

Said that even the faker-thread should be waiting to get S-LATCH if other sql-thread is holding X-latch so I couldn't understand the scenario. May be some other scenario exist.

Revision history for this message
Krunal Bauskar (krunal-bauskar) wrote :

There is no TC attached. Patch comment doesn't help understand what scenario is possible.
May be if we get to see a scenario we can re-open this but we don't see any such possibility.
Also, related bug in this area are fixed. If that is what this patch was trying to address but then patch look a real short-cut to address that scenario.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Percona Server 5.6 because there has been no activity for 60 days.]

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1402

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.