From 1e28cffa43dcac1947abad3dc22f3805aad16608 Mon Sep 17 00:00:00 2001 From: Zardosht Kasheff Date: Wed, 9 Jun 2010 17:45:49 +0000 Subject: [PATCH] [t:2727],[t:2728], make commit progress indicator more clear, have proper error show up when process is killed during loader->close git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@21077 c7de825b-a66e-492c-adef-691d508d4ae1 --- storage/tokudb/ha_tokudb.cc | 7 ++++- storage/tokudb/hatoku_hton.cc | 50 +++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 8b53b5cce5c..a74f0184524 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -2916,7 +2916,12 @@ int ha_tokudb::end_bulk_insert() { if (!abort_loader && !thd->killed) { error = loader->close(loader); loader = NULL; - if (error) { goto cleanup; } + if (error) { + if (thd->killed) { + my_error(ER_QUERY_INTERRUPTED, MYF(0)); + } + goto cleanup; + } for (uint i = 0; i < table_share->keys; i++) { if (table_share->key_info[i].flags & HA_NOSAME) { diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 0c2976f1bca..4c2bcf064f6 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -517,22 +517,44 @@ void txn_progress_func(TOKU_TXN_PROGRESS progress, void* extra) { TXN_PROGRESS_INFO progress_info = (TXN_PROGRESS_INFO)extra; int r; if (progress->stalled_on_checkpoint) { - r = sprintf( - progress_info->status, - "Writing committed changes to disk, processed %"PRId64" out of %"PRId64, - progress->entries_processed, - progress->entries_total - ); - assert(r >= 0); + if (progress->is_commit) { + r = sprintf( + progress_info->status, + "Writing committed changes to disk, processing commit of transaction, %"PRId64" out of %"PRId64, + progress->entries_processed, + progress->entries_total + ); + assert(r >= 0); + } + else { + r = sprintf( + progress_info->status, + "Writing committed changes to disk, processing abort of transaction, %"PRId64" out of %"PRId64, + progress->entries_processed, + progress->entries_total + ); + assert(r >= 0); + } } else { - r = sprintf( - progress_info->status, - "processed %"PRId64" out of %"PRId64, - progress->entries_processed, - progress->entries_total - ); - assert(r >= 0); + if (progress->is_commit) { + r = sprintf( + progress_info->status, + "processing commit of transaction, %"PRId64" out of %"PRId64, + progress->entries_processed, + progress->entries_total + ); + assert(r >= 0); + } + else { + r = sprintf( + progress_info->status, + "processing abort of transaction, %"PRId64" out of %"PRId64, + progress->entries_processed, + progress->entries_total + ); + assert(r >= 0); + } } thd_proc_info(progress_info->thd, progress_info->status); }