diff --git a/client/tarantar/cursor.c b/client/tarantar/cursor.c index fd1e3e95ea0bc756bb421d93b244ac22d287ed42..8abd26c6f106677acb422075814d43ed3e7dd8e5 100644 --- a/client/tarantar/cursor.c +++ b/client/tarantar/cursor.c @@ -44,12 +44,12 @@ ts_cursor_open(struct ts_cursor *c, struct ts_key *k) } rc = tnt_log_seek(&c->current, k->offset); if (rc == -1) { - printf("failed to seek for: %s:%d\n", c->r->file, k->offset); + printf("failed to seek for: %s:%"PRIu64"\n", c->r->file, k->offset); tnt_log_close(&c->current); return -1; } if (tnt_log_next(&c->current) == NULL) { - printf("failed to read: %s:%d\n", c->r->file, k->offset); + printf("failed to read: %s:%"PRIu64"\n", c->r->file, k->offset); tnt_log_close(&c->current); return -1; } @@ -69,9 +69,12 @@ ts_cursor_tuple(struct ts_cursor *c) case TNT_OP_INSERT: t = &rp->r.insert.t; break; + case TNT_OP_DELETE_1_3: + t = &rp->r.del_1_3.t; + return t; case TNT_OP_DELETE: t = &rp->r.del.t; - return 0; + return t; case TNT_OP_UPDATE: assert(0); break; diff --git a/client/tarantar/indexate.c b/client/tarantar/indexate.c index 0e4033057c01f2fd17b3e8bc248df90778ada20b..0899cd8d66a8c46b9e73d2bc275c309ff9869f54 100644 --- a/client/tarantar/indexate.c +++ b/client/tarantar/indexate.c @@ -57,7 +57,7 @@ search_equal(const struct ts_key *a, } static int -snapshot_process_row(struct ts_spaces *s, int fileid, int offset, +snapshot_process_row(struct ts_spaces *s, int fileid, uint64_t offset, struct tnt_iter_storage *is, struct tnt_stream_snapshot *ss) { @@ -163,7 +163,8 @@ snapdir_process(void) } static int -xlog_process_row(struct ts_spaces *s, int fileid, int offset, struct tnt_request *r) +xlog_process_row(struct ts_spaces *s, int fileid, uint64_t offset, + struct tnt_request *r) { /* validate operation */ uint32_t ns = 0; @@ -178,6 +179,10 @@ xlog_process_row(struct ts_spaces *s, int fileid, int offset, struct tnt_request ns = r->r.del.h.ns; t = &r->r.del.t; break; + case TNT_OP_DELETE_1_3: + ns = r->r.del_1_3.h.ns; + t = &r->r.del_1_3.t; + break; case TNT_OP_UPDATE: ns = r->r.update.h.ns; t = &r->r.update.t; @@ -214,6 +219,7 @@ xlog_process_row(struct ts_spaces *s, int fileid, int offset, struct tnt_request } ts_oomcheck(); break; + case TNT_OP_DELETE_1_3: case TNT_OP_DELETE: { pos = mh_pk_get(space->index, &node, space); assert(pos != mh_end(space->index)); diff --git a/client/tarantar/key.h b/client/tarantar/key.h index ebdca6c5458a2598466659aa8f96fcccde35d87c..7660e3c9af8e711f8ffc65f0d3a694f5d2a4ae3e 100644 --- a/client/tarantar/key.h +++ b/client/tarantar/key.h @@ -4,8 +4,8 @@ #define TS_KEY_WITH_DATA 1 struct ts_key { - uint32_t file; - uint32_t offset; + uint16_t file; + uint64_t offset; uint8_t flags; unsigned char key[]; } __attribute__((packed)); diff --git a/client/tarantar/snapshot.c b/client/tarantar/snapshot.c index 61958729a7efa82202dc815543d6c7cb95fd35dc..83ddc10b62066b121bf7e6ba338e949aede9ce9b 100644 --- a/client/tarantar/snapshot.c +++ b/client/tarantar/snapshot.c @@ -88,11 +88,11 @@ ts_snapshot_xfer(FILE *snapshot, struct tnt_log *current, { int rc = tnt_log_seek(current, k->offset); if (rc == -1) { - printf("failed to seek for: %s:%d\n", r->file, k->offset); + printf("failed to seek for: %s:%"PRIu64"\n", r->file, k->offset); return -1; } if (tnt_log_next(current) == NULL) { - printf("failed to read: %s:%d\n", r->file, k->offset); + printf("failed to read: %s:%"PRIu64"\n", r->file, k->offset); return -1; } @@ -106,8 +106,10 @@ ts_snapshot_xfer(FILE *snapshot, struct tnt_log *current, case TNT_OP_INSERT: t = &rp->r.insert.t; break; + case TNT_OP_DELETE_1_3: case TNT_OP_DELETE: - t = &rp->r.del.t; + /* skip */ + //t = &rp->r.del.t; return 0; case TNT_OP_UPDATE: assert(0); diff --git a/client/tarantar/space.c b/client/tarantar/space.c index 7391dbfcbe38592b1be051545e4313888fd9a414..17c6b93b2fb9502c15dc6e90967c51bc78e4ab2f 100644 --- a/client/tarantar/space.c +++ b/client/tarantar/space.c @@ -254,7 +254,7 @@ int ts_space_fill(struct ts_spaces *s, struct ts_options *opts) static inline struct ts_key* ts_space_keyalloc_sha(struct ts_space *s, struct tnt_tuple *t, int fileid, - int offset, int attach) + uint64_t offset, int attach) { int size = sizeof(struct ts_key) + s->key_size; if (attach) @@ -299,7 +299,7 @@ ts_space_keyalloc_sha(struct ts_space *s, struct tnt_tuple *t, int fileid, static inline struct ts_key* ts_space_keyalloc_sparse(struct ts_space *s, struct tnt_tuple *t, int fileid, - int offset, int attach) + uint64_t offset, int attach) { int size = sizeof(struct ts_key) + s->key_size; if (attach) @@ -343,7 +343,7 @@ ts_space_keyalloc_sparse(struct ts_space *s, struct tnt_tuple *t, int fileid, struct ts_key* ts_space_keyalloc(struct ts_space *s, struct tnt_tuple *t, int fileid, - int offset, int attach) + uint64_t offset, int attach) { struct ts_key *k = NULL; switch (s->c) { diff --git a/client/tarantar/space.h b/client/tarantar/space.h index 7ead69e40bc55863e279d1aa43f6e63558dca1a0..b028c65c1cb0bf3139fa56b9dd590e8b309ff5d5 100644 --- a/client/tarantar/space.h +++ b/client/tarantar/space.h @@ -50,7 +50,7 @@ int ts_space_fill(struct ts_spaces *s, struct ts_options *opts); struct ts_key* ts_space_keyalloc(struct ts_space *s, struct tnt_tuple *t, int fileid, - int offset, int attach); + uint64_t offset, int attach); void ts_space_keyfree(struct ts_space *s, struct ts_key *k);