~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Brian Aker
  • Date: 2010-04-06 06:50:19 UTC
  • mfrom: (1405.3.9 replication-api)
  • Revision ID: brian@gaz-20100406065019-n387mztxp1i75qel
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
2259
2259
                        pthread_mutex_unlock(&commit_cond_m);
2260
2260
                }
2261
2261
 
2262
 
                if (trx->conc_state == TRX_PREPARED) {
2263
 
 
2264
 
                        pthread_mutex_unlock(&prepare_commit_mutex);
2265
 
                }
2266
 
 
2267
2262
                /* Now do a write + flush of logs. */
2268
2263
                trx_commit_complete_for_mysql(trx);
2269
2264
 
8150
8145
 
8151
8146
        srv_active_wake_master_thread();
8152
8147
 
8153
 
        if (all || !session_test_options(session, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
8154
 
        {
8155
 
 
8156
 
                /* For ibbackup to work the order of transactions in binlog
8157
 
                and InnoDB must be the same. Consider the situation
8158
 
 
8159
 
                  thread1> prepare; write to binlog; ...
8160
 
                          <context switch>
8161
 
                  thread2> prepare; write to binlog; commit
8162
 
                  thread1>                           ... commit
8163
 
 
8164
 
                To ensure this will not happen we're taking the mutex on
8165
 
                prepare, and releasing it on commit.
8166
 
 
8167
 
                Note: only do it for normal commits, done via ha_commit_trans.
8168
 
                If 2pc protocol is executed by external transaction
8169
 
                coordinator, it will be just a regular MySQL client
8170
 
                executing XA PREPARE and XA COMMIT commands.
8171
 
                In this case we cannot know how many minutes or hours
8172
 
                will be between XA PREPARE and XA COMMIT, and we don't want
8173
 
                to block for undefined period of time.
8174
 
                */
8175
 
                pthread_mutex_lock(&prepare_commit_mutex);
8176
 
                trx->conc_state = TRX_PREPARED;
8177
 
        }
8178
8148
        return(error);
8179
8149
}
8180
8150