--- percona-xtradb-cluster-5.5-5.5.37-25.10+dfsg.orig/sql/wsrep_hton.cc +++ percona-xtradb-cluster-5.5-5.5.37-25.10+dfsg/sql/wsrep_hton.cc @@ -485,7 +485,7 @@ case WSREP_BF_ABORT: DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); case WSREP_TRX_FAIL: - WSREP_DEBUG("commit failed for reason: %d", rcode); + WSREP_DEBUG("commit failed for reason: %d %lu %s", rcode, thd->thread_id, thd->query()); DBUG_PRINT("wsrep", ("replicating commit fail")); thd->wsrep_query_state= QUERY_EXEC; --- percona-xtradb-cluster-5.5-5.5.37-25.10+dfsg.orig/storage/innobase/handler/ha_innodb.cc +++ percona-xtradb-cluster-5.5-5.5.37-25.10+dfsg/storage/innobase/handler/ha_innodb.cc @@ -6684,6 +6684,14 @@ #ifdef WITH_WSREP /* workaround for LP bug #355000, retrying the insert */ case SQLCOM_INSERT: + + WSREP_DEBUG("DUPKEY error for autoinc\n" + "THD %ld, value %llu, off %llu inc %llu", + wsrep_thd_thread_id(current_thd), + auto_inc, + prebuilt->autoinc_offset, + prebuilt->autoinc_increment); + if (wsrep_on(current_thd) && auto_inc_inserted && wsrep_drupal_282555_workaround && @@ -8253,10 +8261,10 @@ DBUG_ENTER("wsrep_append_key"); bool const copy = true; #ifdef WSREP_DEBUG_PRINT - fprintf(stderr, "%s conn %ld, trx %llu, keylen %d, table %s ", + fprintf(stderr, "%s conn %ld, trx %llu, keylen %d, table %s\n SQL: %s ", (shared) ? "Shared" : "Exclusive", wsrep_thd_thread_id(thd), trx->id, key_len, - table_share->table_name.str); + table_share->table_name.str, wsrep_thd_query(thd)); for (int i=0; iautoinc_increment > increment) { +#ifdef WITH_WSREP + WSREP_DEBUG("autoinc decrease: %llu -> %llu\n" + "THD: %ld, current: %llu, autoinc: %llu", + prebuilt->autoinc_increment, + increment, + wsrep_thd_thread_id(ha_thd()), + current, autoinc); + if (!wsrep_on(ha_thd())) + { +#endif /* WITH_WSREP */ current = autoinc - prebuilt->autoinc_increment; +#ifdef WITH_WSREP + } +#endif /* WITH_WSREP */ current = innobase_next_autoinc( current, 1, increment, 1, col_max_value);