~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/xa_resource_manager.cc

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
 
#include <drizzled/cached_directory.h>
 
23
#include "drizzled/cached_directory.h"
24
24
 
25
25
#include <drizzled/definitions.h>
26
26
#include <drizzled/session.h>
27
27
#include <drizzled/error.h>
28
28
#include <drizzled/gettext.h>
29
29
#include <drizzled/plugin/xa_resource_manager.h>
30
 
#include <drizzled/xid.h>
 
30
#include "drizzled/xid.h"
31
31
 
32
32
 
33
33
#include <string>
111
111
  
112
112
    while ((got= resource_manager->xaRecover(trans_list, trans_len)) > 0 )
113
113
    {
114
 
      errmsg_printf(error::INFO,
 
114
      errmsg_printf(ERRMSG_LVL_INFO,
115
115
                    _("Found %d prepared transaction(s) in resource manager."),
116
116
                    got);
117
117
      for (int i=0; i < got; i ++)
174
174
  }
175
175
  if (!trans_list)
176
176
  {
177
 
    errmsg_printf(error::ERROR, ER(ER_OUTOFMEMORY), trans_len*sizeof(XID));
 
177
    errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_OUTOFMEMORY), trans_len*sizeof(XID));
178
178
    return(1);
179
179
  }
180
180
 
181
181
  if (commit_list.size())
182
 
    errmsg_printf(error::INFO, _("Starting crash recovery..."));
 
182
    errmsg_printf(ERRMSG_LVL_INFO, _("Starting crash recovery..."));
183
183
 
184
184
  XaRecover recover_func(trans_list, trans_len, commit_list, dry_run);
185
185
  std::for_each(xa_resource_managers.begin(),
188
188
  free(trans_list);
189
189
 
190
190
  if (recover_func.getForeignXIDs())
191
 
    errmsg_printf(error::WARN,
 
191
    errmsg_printf(ERRMSG_LVL_WARN,
192
192
                  _("Found %d prepared XA transactions"),
193
193
                  recover_func.getForeignXIDs());
194
 
 
195
194
  if (dry_run && recover_func.getMyXIDs())
196
195
  {
197
 
    errmsg_printf(error::ERROR,
 
196
    errmsg_printf(ERRMSG_LVL_ERROR,
198
197
                  _("Found %d prepared transactions! It means that drizzled "
199
198
                    "was not shut down properly last time and critical "
200
199
                    "recovery information (last binlog or %s file) was "
204
203
                    recover_func.getMyXIDs(), opt_tc_log_file);
205
204
    return(1);
206
205
  }
207
 
 
208
206
  if (commit_list.size())
209
 
    errmsg_printf(error::INFO, _("Crash recovery finished."));
210
 
 
 
207
    errmsg_printf(ERRMSG_LVL_INFO, _("Crash recovery finished."));
211
208
  return(0);
212
209
}
213
210