Commit df99a5f2 authored by Yoni Fogel's avatar Yoni Fogel

[t:2499]Added TOKUDB_CANCELED error code for use in canceling during poll function of loader.

git-svn-id: file:///svn/toku/tokudb@19950 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5f48e066
...@@ -17,6 +17,8 @@ MYSQL_H = -I$(BDBDIR)/db-4.1.25/build_unix/ ...@@ -17,6 +17,8 @@ MYSQL_H = -I$(BDBDIR)/db-4.1.25/build_unix/
OPTFLAGS = -O2 OPTFLAGS = -O2
ifeq ($(GCCVERSION),4.4.2) ifeq ($(GCCVERSION),4.4.2)
GCC_VERSION_SPECIFIC_WARNINGS = -Wno-strict-aliasing -Wno-deprecated GCC_VERSION_SPECIFIC_WARNINGS = -Wno-strict-aliasing -Wno-deprecated
else ifeq ($(GCCVERSION),4.4.1)
GCC_VERSION_SPECIFIC_WARNINGS = -Wno-strict-aliasing -Wno-deprecated
endif endif
CFLAGS = $(GCC_VERSION_SPECIFIC_WARNINGS) -Wall -W -Werror -g $(OPTFLAGS) CFLAGS = $(GCC_VERSION_SPECIFIC_WARNINGS) -Wall -W -Werror -g $(OPTFLAGS)
CPPFLAGS = -I. -I../toku_include CPPFLAGS = -I. -I../toku_include
......
...@@ -193,11 +193,12 @@ typedef enum { ...@@ -193,11 +193,12 @@ typedef enum {
/* TOKUDB specific error codes */ /* TOKUDB specific error codes */
#define TOKUDB_OUT_OF_LOCKS -100000 #define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001 #define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
#define TOKUDB_DICTIONARY_TOO_OLD -100004 #define TOKUDB_DICTIONARY_TOO_OLD -100004
#define TOKUDB_DICTIONARY_TOO_NEW -100005 #define TOKUDB_DICTIONARY_TOO_NEW -100005
#define TOKUDB_DICTIONARY_NO_HEADER -100006 #define TOKUDB_DICTIONARY_NO_HEADER -100006
#define TOKUDB_FOUND_BUT_REJECTED -100002 #define TOKUDB_CANCELED -100007
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* LOADER flags */ /* LOADER flags */
#define LOADER_USE_PUTS 1 #define LOADER_USE_PUTS 1
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/ /* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
......
...@@ -195,11 +195,12 @@ typedef enum { ...@@ -195,11 +195,12 @@ typedef enum {
/* TOKUDB specific error codes */ /* TOKUDB specific error codes */
#define TOKUDB_OUT_OF_LOCKS -100000 #define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001 #define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
#define TOKUDB_DICTIONARY_TOO_OLD -100004 #define TOKUDB_DICTIONARY_TOO_OLD -100004
#define TOKUDB_DICTIONARY_TOO_NEW -100005 #define TOKUDB_DICTIONARY_TOO_NEW -100005
#define TOKUDB_DICTIONARY_NO_HEADER -100006 #define TOKUDB_DICTIONARY_NO_HEADER -100006
#define TOKUDB_FOUND_BUT_REJECTED -100002 #define TOKUDB_CANCELED -100007
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* LOADER flags */ /* LOADER flags */
#define LOADER_USE_PUTS 1 #define LOADER_USE_PUTS 1
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/ /* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
......
...@@ -197,11 +197,12 @@ typedef enum { ...@@ -197,11 +197,12 @@ typedef enum {
/* TOKUDB specific error codes */ /* TOKUDB specific error codes */
#define TOKUDB_OUT_OF_LOCKS -100000 #define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001 #define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
#define TOKUDB_DICTIONARY_TOO_OLD -100004 #define TOKUDB_DICTIONARY_TOO_OLD -100004
#define TOKUDB_DICTIONARY_TOO_NEW -100005 #define TOKUDB_DICTIONARY_TOO_NEW -100005
#define TOKUDB_DICTIONARY_NO_HEADER -100006 #define TOKUDB_DICTIONARY_NO_HEADER -100006
#define TOKUDB_FOUND_BUT_REJECTED -100002 #define TOKUDB_CANCELED -100007
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* LOADER flags */ /* LOADER flags */
#define LOADER_USE_PUTS 1 #define LOADER_USE_PUTS 1
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/ /* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
......
...@@ -197,11 +197,12 @@ typedef enum { ...@@ -197,11 +197,12 @@ typedef enum {
/* TOKUDB specific error codes */ /* TOKUDB specific error codes */
#define TOKUDB_OUT_OF_LOCKS -100000 #define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001 #define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
#define TOKUDB_DICTIONARY_TOO_OLD -100004 #define TOKUDB_DICTIONARY_TOO_OLD -100004
#define TOKUDB_DICTIONARY_TOO_NEW -100005 #define TOKUDB_DICTIONARY_TOO_NEW -100005
#define TOKUDB_DICTIONARY_NO_HEADER -100006 #define TOKUDB_DICTIONARY_NO_HEADER -100006
#define TOKUDB_FOUND_BUT_REJECTED -100002 #define TOKUDB_CANCELED -100007
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* LOADER flags */ /* LOADER flags */
#define LOADER_USE_PUTS 1 #define LOADER_USE_PUTS 1
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/ /* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
......
...@@ -199,11 +199,12 @@ typedef enum { ...@@ -199,11 +199,12 @@ typedef enum {
/* TOKUDB specific error codes */ /* TOKUDB specific error codes */
#define TOKUDB_OUT_OF_LOCKS -100000 #define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001 #define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
#define TOKUDB_DICTIONARY_TOO_OLD -100004 #define TOKUDB_DICTIONARY_TOO_OLD -100004
#define TOKUDB_DICTIONARY_TOO_NEW -100005 #define TOKUDB_DICTIONARY_TOO_NEW -100005
#define TOKUDB_DICTIONARY_NO_HEADER -100006 #define TOKUDB_DICTIONARY_NO_HEADER -100006
#define TOKUDB_FOUND_BUT_REJECTED -100002 #define TOKUDB_CANCELED -100007
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* LOADER flags */ /* LOADER flags */
#define LOADER_USE_PUTS 1 #define LOADER_USE_PUTS 1
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/ /* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
......
...@@ -66,7 +66,8 @@ enum { ...@@ -66,7 +66,8 @@ enum {
TOKUDB_USER_CALLBACK_ERROR = -100003, TOKUDB_USER_CALLBACK_ERROR = -100003,
TOKUDB_DICTIONARY_TOO_OLD = -100004, TOKUDB_DICTIONARY_TOO_OLD = -100004,
TOKUDB_DICTIONARY_TOO_NEW = -100005, TOKUDB_DICTIONARY_TOO_NEW = -100005,
TOKUDB_DICTIONARY_NO_HEADER = -100006 TOKUDB_DICTIONARY_NO_HEADER = -100006,
TOKUDB_CANCELED = -100007,
}; };
static void print_defines (void) { static void print_defines (void) {
...@@ -190,11 +191,12 @@ static void print_defines (void) { ...@@ -190,11 +191,12 @@ static void print_defines (void) {
printf("/* TOKUDB specific error codes */\n"); printf("/* TOKUDB specific error codes */\n");
dodefine(TOKUDB_OUT_OF_LOCKS); dodefine(TOKUDB_OUT_OF_LOCKS);
dodefine(TOKUDB_SUCCEEDED_EARLY); dodefine(TOKUDB_SUCCEEDED_EARLY);
dodefine(TOKUDB_FOUND_BUT_REJECTED);
dodefine(TOKUDB_USER_CALLBACK_ERROR);
dodefine(TOKUDB_DICTIONARY_TOO_OLD); dodefine(TOKUDB_DICTIONARY_TOO_OLD);
dodefine(TOKUDB_DICTIONARY_TOO_NEW); dodefine(TOKUDB_DICTIONARY_TOO_NEW);
dodefine(TOKUDB_DICTIONARY_NO_HEADER); dodefine(TOKUDB_DICTIONARY_NO_HEADER);
dodefine(TOKUDB_FOUND_BUT_REJECTED); dodefine(TOKUDB_CANCELED);
dodefine(TOKUDB_USER_CALLBACK_ERROR);
/* LOADER flags */ /* LOADER flags */
printf("/* LOADER flags */\n"); printf("/* LOADER flags */\n");
......
...@@ -199,11 +199,12 @@ typedef enum { ...@@ -199,11 +199,12 @@ typedef enum {
/* TOKUDB specific error codes */ /* TOKUDB specific error codes */
#define TOKUDB_OUT_OF_LOCKS -100000 #define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001 #define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
#define TOKUDB_DICTIONARY_TOO_OLD -100004 #define TOKUDB_DICTIONARY_TOO_OLD -100004
#define TOKUDB_DICTIONARY_TOO_NEW -100005 #define TOKUDB_DICTIONARY_TOO_NEW -100005
#define TOKUDB_DICTIONARY_NO_HEADER -100006 #define TOKUDB_DICTIONARY_NO_HEADER -100006
#define TOKUDB_FOUND_BUT_REJECTED -100002 #define TOKUDB_CANCELED -100007
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* LOADER flags */ /* LOADER flags */
#define LOADER_USE_PUTS 1 #define LOADER_USE_PUTS 1
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/ /* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
......
...@@ -199,11 +199,12 @@ typedef enum { ...@@ -199,11 +199,12 @@ typedef enum {
/* TOKUDB specific error codes */ /* TOKUDB specific error codes */
#define TOKUDB_OUT_OF_LOCKS -100000 #define TOKUDB_OUT_OF_LOCKS -100000
#define TOKUDB_SUCCEEDED_EARLY -100001 #define TOKUDB_SUCCEEDED_EARLY -100001
#define TOKUDB_FOUND_BUT_REJECTED -100002
#define TOKUDB_USER_CALLBACK_ERROR -100003
#define TOKUDB_DICTIONARY_TOO_OLD -100004 #define TOKUDB_DICTIONARY_TOO_OLD -100004
#define TOKUDB_DICTIONARY_TOO_NEW -100005 #define TOKUDB_DICTIONARY_TOO_NEW -100005
#define TOKUDB_DICTIONARY_NO_HEADER -100006 #define TOKUDB_DICTIONARY_NO_HEADER -100006
#define TOKUDB_FOUND_BUT_REJECTED -100002 #define TOKUDB_CANCELED -100007
#define TOKUDB_USER_CALLBACK_ERROR -100003
/* LOADER flags */ /* LOADER flags */
#define LOADER_USE_PUTS 1 #define LOADER_USE_PUTS 1
/* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/ /* in wrap mode, top-level function txn_begin is renamed, but the field isn't renamed, so we have to hack it here.*/
......
...@@ -183,9 +183,6 @@ static void check_results(DB **dbs) ...@@ -183,9 +183,6 @@ static void check_results(DB **dbs)
static void *expect_poll_void = &expect_poll_void; static void *expect_poll_void = &expect_poll_void;
static uint64_t poll_count=0; static uint64_t poll_count=0;
static uint64_t bomb_after_poll_count=UINT64_MAX; static uint64_t bomb_after_poll_count=UINT64_MAX;
#if TOKU_WINDOWS
#define ECANCELED (-1)
#endif
static int poll_function (void *extra, float progress) { static int poll_function (void *extra, float progress) {
if (0) { if (0) {
static int did_one=0; static int did_one=0;
...@@ -202,7 +199,7 @@ static int poll_function (void *extra, float progress) { ...@@ -202,7 +199,7 @@ static int poll_function (void *extra, float progress) {
assert(0.0<=progress && progress<=1.0); assert(0.0<=progress && progress<=1.0);
poll_count++; // Calls to poll_function() are protected by a lock, so we don't have to do this atomically. poll_count++; // Calls to poll_function() are protected by a lock, so we don't have to do this atomically.
if (poll_count>bomb_after_poll_count) if (poll_count>bomb_after_poll_count)
return ECANCELED; return TOKUDB_CANCELED;
else else
return 0; return 0;
} }
...@@ -263,7 +260,7 @@ static void test_loader(DB **dbs) ...@@ -263,7 +260,7 @@ static void test_loader(DB **dbs)
printf("%9.6fs closing", elapsed_time()); fflush(stdout); printf("%9.6fs closing", elapsed_time()); fflush(stdout);
r = loader->close(loader); r = loader->close(loader);
printf(" done\n"); printf(" done\n");
CKERR2s(r,0,ECANCELED); CKERR2s(r,0,TOKUDB_CANCELED);
if (r==0) { if (r==0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment