~ignacio-nin/+junk/percona-xtradb-cluster-galera

« back to all changes in this revision

Viewing changes to galera/src/replicator_smm.cpp

  • Committer: Alex Yurchenko
  • Date: 2011-11-13 20:37:10 UTC
  • mfrom: (87.1.2 1.x)
  • Revision ID: ayurchen@void-20111113203710-l2hjr20de14hk79j
References lp:884566 - synced with SVN branch 2.x r2509

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
    sst_mutex_          (),
195
195
    sst_cond_           (),
196
196
    sst_retry_sec_      (1),
197
 
    trivial_sst_        (false),
 
197
    ist_sst_            (false),
198
198
    gcache_             (config_, data_dir_),
199
199
    gcs_                (config_, gcache_, MAX_PROTO_VER, args->proto_ver,
200
200
                         args->node_name, args->node_incoming),
951
951
    }
952
952
 
953
953
    try {
954
 
        if (!trivial_sst_) gcs_.join(seqno);
 
954
        // #557 - remove this if() when we return back to joining after SST
 
955
        if (!ist_sst_ || seqno < 0) gcs_.join(seqno);
 
956
        ist_sst_ = false;
955
957
        return WSREP_OK;
956
958
    }
957
959
    catch (gu::Exception& e)
1158
1160
        if (state_() == S_JOINING && sst_state_ != SST_NONE)
1159
1161
        {
1160
1162
            /* There are two reasons we can be here:
1161
 
             * 1) we just got state transfer in request_sst() above;
 
1163
             * 1) we just got state transfer in request_state_transfer() above;
1162
1164
             * 2) we failed here previously (probably due to partition).
1163
1165
             */
1164
1166
            try {
1259
1261
 
1260
1262
void galera::ReplicatorSMM::desync() throw (gu::Exception)
1261
1263
{
1262
 
    gcs_.desync();
 
1264
    wsrep_seqno_t const seqno_l(gcs_.desync());
 
1265
 
 
1266
    if (seqno_l >= 0)
 
1267
    {
 
1268
        if (local_monitor_.would_block(seqno_l))
 
1269
        {
 
1270
            gu_throw_error (-EDEADLK) << "Ran out of resources waiting to "
 
1271
                                      << "desync the node."
 
1272
                                      << "Application restart required";
 
1273
        }
 
1274
 
 
1275
        LocalOrder lo(seqno_l);
 
1276
        local_monitor_.enter(lo);
 
1277
        state_.shift_to(S_DONOR);
 
1278
        local_monitor_.leave(lo);
 
1279
    }
 
1280
    else
 
1281
    {
 
1282
        gu_throw_error (-seqno_l) << "Node desync failed";
 
1283
    }
1263
1284
}
1264
1285
 
1265
1286
void galera::ReplicatorSMM::resync() throw (gu::Exception)