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

« back to all changes in this revision

Viewing changes to galera/src/gcs.hpp

  • 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:
39
39
        virtual ssize_t request_state_transfer(const void* req, ssize_t req_len,
40
40
                                               const std::string& sst_donor,
41
41
                                               gcs_seqno_t* seqno_l) = 0;
42
 
        virtual void    desync () throw (gu::Exception) = 0;
 
42
        virtual gcs_seqno_t desync() throw () = 0;
43
43
        virtual void    join(gcs_seqno_t seqno) throw (gu::Exception) = 0;
44
44
        virtual void    get_stats(gcs_stats*) const = 0;
45
45
 
133
133
                                              sst_donor.c_str(), seqno_l);
134
134
        }
135
135
 
136
 
        void desync () throw (gu::Exception)
 
136
        gcs_seqno_t desync () throw ()
137
137
        {
138
 
            long err;
 
138
            gcs_seqno_t ret;
139
139
 
140
140
            // WARNING: Here we have application block on this call which
141
141
            //          may prevent application from resolving the issue.
142
142
            //          (Not that we expect that application can resolve it.)
143
 
            while (-EAGAIN == (err = gcs_desync(conn_)))
 
143
            for (long i = 0; i < 100 && (-EAGAIN == (ret = gcs_desync(conn_)));
 
144
                 ++i) // limit blocking time to 10s
144
145
            {
145
146
                log_warn << "Retrying DESYNC request.";
146
147
                usleep (100000); // 0.1s
147
148
            }
148
149
 
149
 
            if (err < 0) { gu_throw_error (-err) << "gcs_desync() failed"; }
 
150
            return ret;
150
151
        }
151
152
 
152
153
        void join (gcs_seqno_t seqno) throw (gu::Exception)
308
309
            return -ENOSYS;
309
310
        }
310
311
 
311
 
        void desync () throw (gu::Exception)
 
312
        gcs_seqno_t desync () throw ()
312
313
        {
313
 
            gu_throw_error(ENOTCONN);
 
314
            return -ENOTCONN;
314
315
        }
315
316
 
316
317
        void join(gcs_seqno_t seqno) throw (gu::Exception)