Commit 8c37306c authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

pma move logging works better

git-svn-id: file:///svn/tokudb@918 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8ed7c1b5
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage # GCOV_FLAGS = -fprofile-arcs -ftest-coverage
# PROF_FLAGS = -pg # PROF_FLAGS = -pg
OPTFLAGS = -O2 # OPTFLAGS = -O2
ifeq ($(CYGWIN),cygwin) ifeq ($(CYGWIN),cygwin)
else else
...@@ -51,9 +51,9 @@ tdb_logprint: log_code.o memory.o log.o brt-serialize.o hashtable.o pma.o ybt.o ...@@ -51,9 +51,9 @@ tdb_logprint: log_code.o memory.o log.o brt-serialize.o hashtable.o pma.o ybt.o
recover: LDFLAGS+=-lz recover: LDFLAGS+=-lz
recover.o: log_header.h log-internal.h log.h yerror.h brttypes.h kv-pair.h memory.h key.h recover.o: log_header.h log-internal.h log.h yerror.h brttypes.h kv-pair.h memory.h key.h
recover: log_code.o memory.o log.o brt-serialize.o hashtable.o pma.o ybt.o fingerprint.o mempool.o primes.o cachetable.o brt.o brt-verify.o key.o recover: recover.o log_code.o memory.o log.o brt-serialize.o hashtable.o pma.o ybt.o fingerprint.o mempool.o primes.o cachetable.o brt.o brt-verify.o key.o
log_code.o: log_header.h log_code.o: log_header.h wbuf.h log-internal.h
log_code.c log_header.h: logformat log_code.c log_header.h: logformat
./logformat ./logformat
......
...@@ -487,7 +487,7 @@ int toku_fread_INTPAIRARRAY (FILE *f, INTPAIRARRAY *v, u_int32_t *crc, u_int32_t ...@@ -487,7 +487,7 @@ int toku_fread_INTPAIRARRAY (FILE *f, INTPAIRARRAY *v, u_int32_t *crc, u_int32_t
u_int32_t i; u_int32_t i;
r = toku_fread_u_int32_t(f, &v->size, crc, len); if (r!=0) return r; r = toku_fread_u_int32_t(f, &v->size, crc, len); if (r!=0) return r;
MALLOC_N(v->size, v->array); MALLOC_N(v->size, v->array);
if (v->array!=0) return errno; if (v->array==0) return errno;
for (i=0; i<v->size; i++) { for (i=0; i<v->size; i++) {
r = toku_fread_u_int32_t(f, &v->array[i].a, crc, len); if (r!=0) return r; r = toku_fread_u_int32_t(f, &v->array[i].a, crc, len); if (r!=0) return r;
r = toku_fread_u_int32_t(f, &v->array[i].b, crc, len); if (r!=0) return r; r = toku_fread_u_int32_t(f, &v->array[i].b, crc, len); if (r!=0) return r;
......
...@@ -547,12 +547,16 @@ int toku_pmainternal_smooth_region (TOKUTXN txn, FILENUM filenum, DISKOFF diskof ...@@ -547,12 +547,16 @@ int toku_pmainternal_smooth_region (TOKUTXN txn, FILENUM filenum, DISKOFF diskof
tmppairs, n_saved, pma); tmppairs, n_saved, pma);
{ {
INTPAIRARRAY ipa; INTPAIRARRAY ipa;
ipa.size=n_saved; ipa.size=n_saved-1; /* Don't move the blank spot. */
MALLOC_N(n_saved, ipa.array); MALLOC_N(n_saved, ipa.array);
if (ipa.array==0) return errno; if (ipa.array==0) return errno;
int j=0;
for (i=0; i<n_saved; i++) { for (i=0; i<n_saved; i++) {
ipa.array[i].a = tmppairs[i].oldtag; if (tmppairs[i].newtag!=newidx) {
ipa.array[i].b = tmppairs[i].newtag; ipa.array[j].a = tmppairs[i].oldtag;
ipa.array[j].b = tmppairs[i].newtag;
j++;
}
} }
int r=toku_log_pmadistribute(txn, toku_txn_get_txnid(txn), filenum, diskoff, ipa); int r=toku_log_pmadistribute(txn, toku_txn_get_txnid(txn), filenum, diskoff, ipa);
toku_free(ipa.array); toku_free(ipa.array);
......
...@@ -32,7 +32,7 @@ static void make_db (void) { ...@@ -32,7 +32,7 @@ static void make_db (void) {
r=tid->commit(tid, 0); assert(r==0); r=tid->commit(tid, 0); assert(r==0);
r=env->txn_begin(env, 0, &tid, 0); assert(r==0); r=env->txn_begin(env, 0, &tid, 0); assert(r==0);
for (i=0; i<2; i++) { for (i=0; i<10; i++) {
char hello[30], there[30]; char hello[30], there[30];
DBT key,data; DBT key,data;
snprintf(hello, sizeof(hello), "hello%ld.%d", random(), i); snprintf(hello, sizeof(hello), "hello%ld.%d", random(), i);
......
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