diff --git a/Makefile.am b/Makefile.am index 6d0bda7ece..1e67ca368d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1512,13 +1512,6 @@ endif lib_libcyrus_la_LIBADD = libcrc32.la ${LIB_SASL} $(SSL_LIBS) $(GCOV_LIBS) $(LIBM) lib_libcyrus_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY) -if USE_ZEROSKIP -lib_libcyrus_la_SOURCES += lib/cyrusdb_zeroskip.c -lib_libcyrus_la_LIBADD += $(ZEROSKIP_LIBS) -lib_libcyrus_la_CFLAGS += $(ZEROSKIP_CFLAGS) -AM_CPPFLAGS += $(ZEROSKIP_CFLAGS) -endif - noinst_LTLIBRARIES += libcrc32.la libcrc32_la_SOURCES = lib/crc32.c libcrc32_la_CFLAGS = -O3 $(AM_CFLAGS) $(CFLAG_VISIBILITY) diff --git a/bench/cyrdbbench.c b/bench/cyrdbbench.c index 5837f1401b..80454adb93 100644 --- a/bench/cyrdbbench.c +++ b/bench/cyrdbbench.c @@ -247,7 +247,7 @@ static void usage(const char *progname) printf(" -d, --db the db to run the benchmarks on\n"); printf(" (if not provided, will create a new db)\n"); printf(" -t, --backend type of the db backend to run benchmarks on\n"); - printf(" Available Cyrus DB's: twoskip, zeroskip\n"); + printf(" Available Cyrus DB's: twoskip\n"); printf(" -n, --numrecs number of records to write[default: 1000]\n"); printf(" -h, --help display this help and exit\n"); } @@ -480,12 +480,11 @@ int main(int argc, char *argv[]) goto done; } - if (strncmp(BACKEND, "twoskip", strlen("twoskip")) == 0 || - strncmp(BACKEND, "zeroskip", strlen("zeroskip")) == 0) { + if (strncmp(BACKEND, "twoskip", strlen("twoskip")) == 0) { fprintf(stderr, "Running benchmarks for `%s` backend\n", BACKEND); } else { fprintf(stderr, "%s is not a valid CyrusDB backend. ", BACKEND); - fprintf(stderr, "Choose between `twoskip` or `zeroskip`.\n"); + fprintf(stderr, "Only `twoskip` is supported.\n"); ret = EXIT_FAILURE; goto done; } diff --git a/changes/next/remove-zeroskip b/changes/next/remove-zeroskip new file mode 100644 index 0000000000..dd26c73457 --- /dev/null +++ b/changes/next/remove-zeroskip @@ -0,0 +1,14 @@ +Description: + +Remove experimental zeroskip database backend. + + +Config changes: + +Remove any use of zeroskip as database backend. This backend was experimental +and is broken. + + +Upgrade instructions: + +Reconstruct all databases that used the zeroskip backend. diff --git a/configure.ac b/configure.ac index 2c59394462..5ba30fa167 100644 --- a/configure.ac +++ b/configure.ac @@ -1491,22 +1491,6 @@ PKG_CHECK_MODULES([ICU], [icu-i18n >= 55 icu-uc >= 55], [ AC_SUBST([ICU_LIBS]) AC_SUBST([ICU_CFLAGS]) -dnl -dnl Check for zeroskip library, needed for zeroskip support -dnl -AC_ARG_WITH([zeroskip], - [AS_HELP_STRING([--without-zeroskip], [ignore presence of Zeroskip and disable it])], - [], - [with_zeroskip=yes]) -AS_IF([test "x$with_zeroskip" = "xyes"], - [ PKG_CHECK_MODULES([ZEROSKIP], [libzeroskip], - [ AC_DEFINE(HAVE_ZEROSKIP, [], [Do we have Zeroskip?]) - with_zeroskip=yes ], - with_zeroskip=no)]) -AC_SUBST([ZEROSKIP_LIBS]) -AC_SUBST([ZEROSKIP_CFLAGS]) -AM_CONDITIONAL([USE_ZEROSKIP], [test "x$with_zeroskip" = xyes]) - dnl dnl Check for chardet library, needed for charset detection support dnl @@ -2632,7 +2616,6 @@ Database support: mysql: $with_mysql postgresql: $use_pgsql sqlite: $use_sqlite - zeroskip: $with_zeroskip Search engine: squat: $enable_squat diff --git a/cunit/aaa-db.testc b/cunit/aaa-db.testc index dcaef2016f..5fc186a99e 100644 --- a/cunit/aaa-db.testc +++ b/cunit/aaa-db.testc @@ -19,7 +19,7 @@ struct binary_result size_t datalen; }; -static const char *backend = CUNIT_PARAM("skiplist,flat,twoskip,zeroskip"); +static const char *backend = CUNIT_PARAM("skiplist,flat,twoskip"); static char *filename; static char *filename2; @@ -188,27 +188,11 @@ static char *make_basedir(const char * const *reldirs) free(actual); \ } -static int skiptest() -{ - /* cunit.pl doesn't play nice with #ifdef'ed CUNIT_PARAMS */ - - if (!strcmp(backend, "zeroskip")) { -#ifdef HAVE_ZEROSKIP - return 0; -#else - return 1; -#endif - } - return 0; -} - static void test_openclose(void) { struct db *db = NULL; int r; - if (skiptest()) return; - CU_ASSERT_EQUAL(fexists(filename), -ENOENT); /* open() without _CREATE fails with NOTFOUND @@ -245,8 +229,6 @@ static void test_multiopen(void) static const char KEY3[] = "leggings"; static const char DATA3[] = "tumblr salvia"; - if (skiptest()) return; - CU_ASSERT_EQUAL(fexists(filename), -ENOENT); /* open() with _CREATE succeeds and creates the db */ @@ -335,8 +317,6 @@ static void test_opentwo(void) struct db *db2 = NULL; int r; - if (skiptest()) return; - CU_ASSERT_EQUAL(fexists(filename), -ENOENT); CU_ASSERT_EQUAL(fexists(filename2), -ENOENT); @@ -376,8 +356,6 @@ static void test_readwrite(void) static const char DATA[] = "dem bones dem bones dem thighbones"; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -423,8 +401,6 @@ static void test_multirw(void) static const char DATA2[] = "Dem KneeBones"; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -479,8 +455,6 @@ static void test_readwrite_zerolen(void) static const char DATA[] = ""; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -528,8 +502,6 @@ static void test_readwrite_null(void) static const char EMPTY[] = ""; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -575,8 +547,6 @@ static void test_abort(void) static const char DATA[] = "stanford mit harvard"; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -629,8 +599,6 @@ static void test_delete(void) static const char DATA3[] = "flax corm naipaul enable herrera fating"; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -752,8 +720,6 @@ static void test_mboxlist(void) static const char DATA3[] = "aleut stoic muscovy adonis moe docent"; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -815,8 +781,6 @@ static void test_foreach(void) static const char DATA3[] = "aleut stoic muscovy adonis moe docent"; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -1029,8 +993,6 @@ static void test_foreach_changes(void) static const char DATA6[] = "annoying push security plenty ending"; int r; - if (skiptest()) return; - if (!strcmp(backend, "flat")) return; /* flat concurrency is bogus */ r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); @@ -1127,8 +1089,6 @@ static void test_binary_keys(void) struct binary_result *results = NULL; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -1244,8 +1204,6 @@ static void test_binary_data(void) struct binary_result *results = NULL; int r; - if (skiptest()) return; - r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); @@ -1478,8 +1436,6 @@ static void test_many(void) unsigned int n; int r; - if (skiptest()) return; - construct_hash_table(&exphash, (MAXN+1)*4, 0); r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); @@ -1621,8 +1577,7 @@ static void test_foreach_replace(void) struct txn *txn = NULL; struct replace_data data; - if (skiptest() || !strcmp(backend, "flat")) - return; + if (!strcmp(backend, "flat")) return; r = cyrusdb_open(backend, filename, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); diff --git a/cunit/conversations.testc b/cunit/conversations.testc index ee9779e4b3..0c1045e12b 100644 --- a/cunit/conversations.testc +++ b/cunit/conversations.testc @@ -1419,11 +1419,7 @@ static int set_up(void) ); cyrusdb_init(); -#ifdef HAVE_ZEROSKIP - config_conversations_db = "zeroskip"; -#else config_conversations_db = "twoskip"; -#endif return 0; } diff --git a/cunit/libconfig.testc b/cunit/libconfig.testc index c502fe027f..58a723002b 100644 --- a/cunit/libconfig.testc +++ b/cunit/libconfig.testc @@ -957,7 +957,7 @@ static void test_deprecated_string(void) static void test_deprecated_stringlist(void) { /* { "tlscache_db", "twoskip", - * STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), + * STRINGLIST("skiplist", "sql", "twoskip"), * "2.5.0", "tls_sessions_db" } */ const char *val; @@ -1000,14 +1000,14 @@ static void test_deprecated_stringlist(void) config_read_string( "configdirectory: "DBDIR"/conf\n" "tlscache_db: sql\n" - "tls_sessions_db: zeroskip\n" + "tls_sessions_db: twoskip\n" ); CU_ASSERT_SYSLOG(/*all*/0, 1); /* should read new value at the new name */ val = config_getstring(IMAPOPT_TLS_SESSIONS_DB); CU_ASSERT_PTR_NOT_NULL(val); - CU_ASSERT_STRING_EQUAL(val, "zeroskip"); + CU_ASSERT_STRING_EQUAL(val, "twoskip"); } static void test_deprecated_duration(void) diff --git a/docsrc/imap/concepts/deployment/databases.rst b/docsrc/imap/concepts/deployment/databases.rst index f3563ac91f..e36f390ee6 100644 --- a/docsrc/imap/concepts/deployment/databases.rst +++ b/docsrc/imap/concepts/deployment/databases.rst @@ -250,7 +250,7 @@ This is either cyrus.squat in each folder, or if you're using Xapian a single .xapianactive file listing active databases with tier name and number. cyrus.indexed.db is used by the Xapian search engine. Its file type -can be: `twoskip`_ (default), `flat`_, `skiplist`_, or ``zeroskip`` and is +can be: `twoskip`_ (default), `flat`_, or `skiplist`_ and is determined by `search_indexed_db` in :cyrusman:`imapd.conf(5)`. The xapianactive file contains a space separated list of tiers and databases within diff --git a/lib/cyrusdb.c b/lib/cyrusdb.c index 2ae662da74..b06af2dc99 100644 --- a/lib/cyrusdb.c +++ b/lib/cyrusdb.c @@ -72,7 +72,6 @@ extern struct cyrusdb_backend cyrusdb_skiplist; extern struct cyrusdb_backend cyrusdb_quotalegacy; extern struct cyrusdb_backend cyrusdb_sql; extern struct cyrusdb_backend cyrusdb_twoskip; -extern struct cyrusdb_backend cyrusdb_zeroskip; static struct cyrusdb_backend *_backends[] = { &cyrusdb_flat, @@ -82,9 +81,6 @@ static struct cyrusdb_backend *_backends[] = { &cyrusdb_sql, #endif &cyrusdb_twoskip, -#if defined HAVE_ZEROSKIP - &cyrusdb_zeroskip, -#endif NULL }; #define DEFAULT_BACKEND "twoskip" diff --git a/lib/cyrusdb_zeroskip.c b/lib/cyrusdb_zeroskip.c deleted file mode 100644 index d7452c72f0..0000000000 --- a/lib/cyrusdb_zeroskip.c +++ /dev/null @@ -1,604 +0,0 @@ -/* cyrusdb_zeroskip.c - Support for Zeroskip - * - * Copyright (c) 1994-2018 Carnegie Mellon University. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The name "Carnegie Mellon University" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For permission or any legal - * details, please contact - * Carnegie Mellon University - * Center for Technology Transfer and Enterprise Creation - * 4615 Forbes Avenue - * Suite 302 - * Pittsburgh, PA 15213 - * (412) 268-7393, fax: (412) 268-7395 - * innovation@andrew.cmu.edu - * - * 4. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by Computing Services - * at Carnegie Mellon University (http://www.cmu.edu/computing/)." - * - * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include - -#include -#include -#include -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "assert.h" -#include "bsearch.h" -#include "cyrusdb.h" -#include "util.h" -#include "xmalloc.h" - -#include -#include - -struct txn { - struct zsdb_txn *t; -}; - - -struct dbengine { - struct zsdb *db; - struct zsdb_txn **curent_txn; -}; - - -struct dblist { - struct dbengine *db; - struct dblist *next; -}; - -/****** INTERNAL FUNCTIONS ******/ -static int create_or_reuse_txn(struct dbengine *db, - struct txn **curtidptr, - struct txn **newtidptr) -{ - struct txn *tid = NULL; - - assert(newtidptr); - tid = *newtidptr; - - if (!curtidptr || !*curtidptr) { - /* New transaction */ - int r; - - tid = xcalloc(1, sizeof(struct txn)); - r = zsdb_transaction_begin(db->db, &tid->t); - if (r != ZS_OK) { - free(tid); - tid = NULL; - *newtidptr = NULL; - return CYRUSDB_INTERNAL; - } - } else { - /* Existing transaction */ - tid = *curtidptr; - } - - if (curtidptr) - *curtidptr = tid; - - *newtidptr = tid; - - return CYRUSDB_OK; -} - -memtree_memcmp_fn( - mbox, - , - bsearch_memtree_mbox(k, keylen, b, blen) -) -/****** CYRUS DB API ******/ - -HIDDEN int cyrusdb_zeroskip_init(const char *dbdir __attribute__((unused)), - int myflags __attribute__((unused))) -{ - return CYRUSDB_OK; -} - -HIDDEN int cyrusdb_zeroskip_done(void) -{ - return CYRUSDB_OK; -} - -HIDDEN int cyrusdb_zeroskip_sync(void) -{ - return CYRUSDB_OK; -} - -HIDDEN int cyrusdb_zeroskip_archive(const strarray_t *fnames __attribute__((unused)), - const char *dirname __attribute__((unused))) -{ - return CYRUSDB_OK; -} - - -HIDDEN int cyrusdb_zeroskip_unlink(const char *fname __attribute__((unused)), - int flags __attribute__((unused))) -{ - return CYRUSDB_OK; -} - -HIDDEN int cyrusdb_zeroskip_lock(struct dbengine *dbe, struct txn **mytid, - int flags __attribute__((unused))) -{ - struct txn *tid = xmalloc(sizeof(struct txn)); - int r = zsdb_transaction_begin(dbe->db, &tid->t); - if (r != ZS_OK) { - free(tid); - return CYRUSDB_INTERNAL; - } - *mytid = tid; - return 0; -} - -static int cyrusdb_zeroskip_open(const char *fname, - int flags, - struct dbengine **ret, - struct txn **mytid) -{ - struct dbengine *dbe; - int r = CYRUSDB_OK; - int zsdbflags = MODE_RDWR; - - dbe = (struct dbengine *) xzmalloc(sizeof(struct dbengine)); - - if (flags & CYRUSDB_CREATE) - zsdbflags = MODE_CREATE; - - if (zsdb_init(&dbe->db, NULL, NULL) != ZS_OK) { - r = CYRUSDB_IOERROR; - goto done; - } - - r = zsdb_open(dbe->db, fname, zsdbflags); - if (r) { - if (r == ZS_NOTFOUND) r = CYRUSDB_NOTFOUND; - else r = CYRUSDB_IOERROR; - goto finalise_db; - } - - *ret = dbe; - - if (mytid) { - r = cyrusdb_zeroskip_lock(dbe, mytid, flags); - if (r) goto close_db; - } - - r = CYRUSDB_OK; - goto done; - - close_db: - zsdb_close(dbe->db); - finalise_db: - zsdb_final(&dbe->db); - free(dbe); - - done: - return r; -} - -static int cyrusdb_zeroskip_close(struct dbengine *dbe) -{ - int r = CYRUSDB_OK; - - assert(dbe); - assert(dbe->db); - - r = zsdb_close(dbe->db); - if (r) { - r = CYRUSDB_INTERNAL; - goto done; - } - - zsdb_final(&dbe->db); - - free(dbe); - dbe = NULL; - - done: - return r; -} - -static int cyrusdb_zeroskip_fetch(struct dbengine *db, - const char *key, size_t keylen, - const char **data, size_t *datalen, - struct txn **tidptr) -{ - int r = CYRUSDB_OK; - struct txn *tid = NULL; - - assert(db); - assert(key); - assert(keylen); - - if (datalen) assert(data); - - if (data) *data = NULL; - if (datalen) *datalen = 0; - - r = create_or_reuse_txn(db, tidptr, &tid); - if (r) - goto done; - - r = zsdb_fetch(db->db, (const unsigned char *)key, keylen, - (const unsigned char **)data, datalen, - tidptr ? &tid->t : NULL); - if (r == ZS_NOTFOUND){ - r = CYRUSDB_NOTFOUND; - if (data) *data = NULL; - if (datalen) *datalen = 0; - - goto done; - - } else if (r) { - r = CYRUSDB_IOERROR; - goto done; - } - - if (tidptr) { - *tidptr = tid; - } - - r = CYRUSDB_OK; - - done: - if (tid && (!tidptr || !*tidptr)) { - zsdb_transaction_end(&tid->t); - free(tid); - tid = NULL; - } - - return r; -} - -static int cyrusdb_zeroskip_fetchlock(struct dbengine *db, - const char *key, size_t keylen, - const char **data, size_t *datalen, - struct txn **tidptr) -{ - assert(key); - assert(keylen); - - /* TODO: LOCK??? */ - return cyrusdb_zeroskip_fetch(db, key, keylen, - data, datalen, - tidptr); -} - -static int cyrusdb_zeroskip_fetchnext(struct dbengine *db, - const char *key, size_t keylen, - const char **foundkey, size_t *fklen, - const char **data, size_t *datalen, - struct txn **tidptr __attribute__((unused))) -{ - int r = CYRUSDB_OK; - struct txn *tid = NULL; - - assert(db); - - r = zsdb_fetchnext(db->db, (const unsigned char *)key, keylen, - (const unsigned char **)foundkey, fklen, - (const unsigned char **)data, datalen, - &tid->t); - if (r != ZS_OK) { - if (r == ZS_NOTFOUND) r = CYRUSDB_NOTFOUND; - else r = CYRUSDB_IOERROR; - goto done; - } - - done: - return r; -} - -static int cyrusdb_zeroskip_foreach(struct dbengine *db, - const char *prefix, size_t prefixlen, - foreach_p *goodp, - foreach_cb *cb, void *rock, - struct txn **tidptr) -{ - int r = CYRUSDB_OK; - struct txn *tid = NULL; - - assert(db); - assert(cb); - - if (prefixlen) assert(prefix); - - r = create_or_reuse_txn(db, tidptr, &tid); - if (r) - goto done; - - /* FIXME: The *ugly* typecasts be removed as soon as we * update the - * CyrusDB interfaces to support `unsigned char *` instead of * `char *`. - */ - r = zsdb_foreach(db->db, (unsigned char *)prefix, prefixlen, - (int (*)(void*, const unsigned char *, size_t , const unsigned char *, size_t))goodp, - (int (*)(void*, const unsigned char *, size_t , const unsigned char *, size_t))cb, - rock, tidptr ? &tid->t : NULL); - if (r != ZS_OK) { - r = CYRUSDB_IOERROR; - goto done; - } - - if (tidptr) { - *tidptr = tid; - } - - r = CYRUSDB_OK; - - done: - if (tid && (!tidptr || !*tidptr)) { - zsdb_transaction_end(&tid->t); - free(tid); - tid = NULL; - } - - return r; -} - -static int cyrusdb_zeroskip_create(struct dbengine *db __attribute__((unused)), - const char *key __attribute__((unused)), - size_t keylen __attribute__((unused)), - const char *data, size_t datalen, - struct txn **tidptr __attribute__((unused))) -{ - if (datalen) assert(data); - - return 0; -} - -static int cyrusdb_zeroskip_store(struct dbengine *db, - const char *key, size_t keylen, - const char *data, size_t datalen, - struct txn **tidptr) -{ - struct txn *tid = NULL; - int r = 0; - - if (datalen) assert(data); - - assert(db); - assert(key && keylen); - - r = create_or_reuse_txn(db, tidptr, &tid); - if (r) - goto done; - - /* Acquire write lock */ - zsdb_write_lock_acquire(db->db, 0); - - r = zsdb_add(db->db, (const unsigned char *)key, keylen, - (const unsigned char *)data, datalen, - tidptr ? &tid->t : NULL); - if (r == ZS_NOTFOUND) { - r = CYRUSDB_NOTFOUND; - goto done; - } else if (r) { - zsdb_abort(db->db, &tid->t); - r = CYRUSDB_IOERROR; - goto done; - } - - if (tidptr) { - *tidptr = tid; - } - - if (r) r = CYRUSDB_IOERROR; - else r = CYRUSDB_OK; - - done: - /* Release write lock */ - zsdb_write_lock_release(db->db); - - if (tid && (!tidptr || !*tidptr)) { - zsdb_transaction_end(&tid->t); - free(tid); - tid = NULL; - } - - return r; -} - -static int cyrusdb_zeroskip_delete(struct dbengine *db, - const char *key, size_t keylen, - struct txn **tidptr, - int force __attribute__((unused))) -{ - struct txn *tid = NULL; - int r = 0; - - if (keylen) assert(key); - - assert(db); - - r = create_or_reuse_txn(db, tidptr, &tid); - if (r) - goto done; - - /* Acquire write lock */ - zsdb_write_lock_acquire(db->db, 0); - - r = zsdb_remove(db->db, (const unsigned char *)key, keylen, &tid->t); - if (r == ZS_NOTFOUND) { - r = CYRUSDB_NOTFOUND; - goto done; - } else if (r) { - r = CYRUSDB_INTERNAL; - goto done; - } - - if (tidptr) { - *tidptr = tid; - } - - if (r) r = CYRUSDB_IOERROR; - else r = CYRUSDB_OK; - - done: - /* Release write lock */ - zsdb_write_lock_release(db->db); - - if (tid && (!tidptr || !*tidptr)) { - zsdb_transaction_end(&tid->t); - free(tid); - tid = NULL; - } - - return r; -} - - -static int cyrusdb_zeroskip_commit(struct dbengine *db, struct txn *tid) -{ - int r = 0; - struct zsdb_txn *t; - - assert(db); - - t = tid ? tid->t : NULL; - - r = zsdb_commit(db->db, &t); - if (r) - r = CYRUSDB_IOERROR; - else - r = CYRUSDB_OK; - - if (tid) - free(tid); - - return r; -} - -static int cyrusdb_zeroskip_abort(struct dbengine *db, struct txn *tid) -{ - assert(db); - assert(tid); - - zsdb_abort(db->db, &tid->t); - free(tid); - tid = NULL; - - return CYRUSDB_OK; -} - -/* cyrusdb_zeroskip_dump: - if detail == 1, dump all records. - if detail == 2, dump active records only -*/ -static int cyrusdb_zeroskip_dump(struct dbengine *db, - int detail) -{ - int r = 0; - - assert(db); - - r = zsdb_dump(db->db, (detail == 1) ? DB_DUMP_ALL : DB_DUMP_ACTIVE); - if (r) - r = CYRUSDB_IOERROR; - else - r = CYRUSDB_OK; - - return r; -} - -static int cyrusdb_zeroskip_consistent(struct dbengine *db __attribute__((unused))) -{ - return 0; -} - -static int cyrusdb_zeroskip_checkpoint(struct dbengine *db) -{ - int r = 0; - - assert(db); - - if (zsdb_pack_lock_acquire(db->db, 0) != ZS_OK) { - r = CYRUSDB_IOERROR; - goto done; - } - - r = zsdb_repack(db->db); - if (r) - r = CYRUSDB_IOERROR; - else - r = CYRUSDB_OK; - - if (zsdb_pack_lock_release(db->db) != ZS_OK) { - r = CYRUSDB_IOERROR; - } - -done: - return r; -} - -static int cyrusdb_zeroskip_compar(const char *a __attribute__((unused)), - int alen __attribute__((unused)), - const char *b __attribute__((unused)), - int blen __attribute__((unused))) -{ - /* return db->compar(a, alen, b, blen); */ - return 0; -} - - -HIDDEN struct cyrusdb_backend cyrusdb_zeroskip = -{ - "zeroskip", /* name */ - - &cyrusdb_zeroskip_init, - &cyrusdb_zeroskip_done, - &cyrusdb_zeroskip_archive, - &cyrusdb_zeroskip_unlink, - - &cyrusdb_zeroskip_open, - &cyrusdb_zeroskip_close, - - &cyrusdb_zeroskip_fetch, - &cyrusdb_zeroskip_fetchlock, - &cyrusdb_zeroskip_fetchnext, - - &cyrusdb_zeroskip_foreach, - &cyrusdb_zeroskip_create, - &cyrusdb_zeroskip_store, - &cyrusdb_zeroskip_delete, - - &cyrusdb_zeroskip_lock, - &cyrusdb_zeroskip_commit, - &cyrusdb_zeroskip_abort, - - &cyrusdb_zeroskip_dump, - &cyrusdb_zeroskip_consistent, - &cyrusdb_zeroskip_checkpoint, - &cyrusdb_zeroskip_compar -}; - diff --git a/lib/imapoptions b/lib/imapoptions index 3f9bb1c350..2f641973df 100644 --- a/lib/imapoptions +++ b/lib/imapoptions @@ -217,7 +217,7 @@ are listed with ``''. /* Alternative INBOX spellings that can't be accessed in altnamespace otherwise go under here. */ -{ "annotation_db", "twoskip", STRINGLIST("skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "annotation_db", "twoskip", STRINGLIST("skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for mailbox annotations. */ { "annotation_db_path", NULL, STRING, "2.5.0" } @@ -549,7 +549,7 @@ Blank lines and lines beginning with ``#'' are ignored. { "backup_retention", "7d", DURATION, "3.12.0", "3.12.0" } /* Deprecated. No longer used. */ -{ "backup_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), "3.12.0", "3.12.0" } +{ "backup_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip"), "UNRELEASED", "3.12.0" } /* Deprecated. No longer used. */ { "backup_db_path", NULL, STRING, "3.12.0", "3.12.0" } @@ -720,7 +720,7 @@ Blank lines and lines beginning with ``#'' are ignored. database with ctl_conversationsdb if you change this option on a running server, or the counts will be wrong. */ -{ "conversations_db", "skiplist", STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), "3.1.6" } +{ "conversations_db", "skiplist", STRINGLIST("skiplist", "sql", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the per-user conversations database. */ { "conversations_expire_days", NULL, DURATION, "3.1.8", "3.1.8", "conversations_expire_after" } @@ -915,7 +915,7 @@ Blank lines and lines beginning with ``#'' are ignored. specifies the actual key used for iSchedule DKIM signing within the domain. */ -{ "duplicate_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), "3.1.6" } +{ "duplicate_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the duplicate delivery suppression and sieve. */ @@ -1797,10 +1797,10 @@ Blank lines and lines beginning with ``#'' are ignored. .PP If no unit is specified, bytes is assumed. */ -{ "mboxkey_db", "twoskip", STRINGLIST("skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "mboxkey_db", "twoskip", STRINGLIST("skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for mailbox keys. */ -{ "mboxlist_db", "twoskip", STRINGLIST("flat", "skiplist", "sql", "twoskip", "zeroskip"), "3.1.6" } +{ "mboxlist_db", "twoskip", STRINGLIST("flat", "skiplist", "sql", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the mailbox list. */ { "mboxlist_db_path", NULL, STRING, "2.5.0" } @@ -2226,7 +2226,7 @@ If all partitions are over that limit, this feature is not used anymore. /* Unix domain socket that ptloader listens on. (defaults to configdirectory/ptclient/ptsock). */ -{ "ptscache_db", "twoskip", STRINGLIST("skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "ptscache_db", "twoskip", STRINGLIST("skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the pts cache. */ { "ptscache_db_path", NULL, STRING, "2.5.0" } @@ -2254,7 +2254,7 @@ If all partitions are over that limit, this feature is not used anymore. /* This specifies the Class Selector or Differentiated Services Code Point designation on IP headers (in the ToS field). */ -{ "quota_db", "quotalegacy", STRINGLIST("flat", "skiplist", "sql", "quotalegacy", "twoskip", "zeroskip"), "3.1.6" } +{ "quota_db", "quotalegacy", STRINGLIST("flat", "skiplist", "sql", "quotalegacy", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for quotas. */ { "quota_db_path", NULL, STRING, "2.5.0" } @@ -2514,7 +2514,7 @@ If all partitions are over that limit, this feature is not used anymore. headers can still be searched, the searches will just be slower. */ -{ "search_indexed_db", "twoskip", STRINGLIST("flat", "skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "search_indexed_db", "twoskip", STRINGLIST("flat", "skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the search latest indexed uid state. Xapian only. */ { "search_maxtime", NULL, STRING, "3.0.0" } @@ -2579,7 +2579,7 @@ If all partitions are over that limit, this feature is not used anymore. .PP This option MUST be specified for xapian search. */ -{ "seenstate_db", "twoskip", STRINGLIST("flat", "skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "seenstate_db", "twoskip", STRINGLIST("flat", "skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the seen state. */ { "sendmail", "/usr/lib/sendmail", STRING, "2.3.17" } @@ -2806,7 +2806,7 @@ product version in the capabilities successfully authenticate. Otherwise lmtpd returns permanent failures (causing the mail to bounce immediately). */ -{ "sortcache_db", "twoskip", STRINGLIST("skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "sortcache_db", "twoskip", STRINGLIST("skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for caching sort results (currently only used for xconvmultisort). */ @@ -2877,7 +2877,7 @@ product version in the capabilities allowed to fetch the contents of any valid "urlauth=submit+" IMAP URL: use with caution. */ -{ "subscription_db", "flat", STRINGLIST("flat", "skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "subscription_db", "flat", STRINGLIST("flat", "skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the subscriptions list. */ { "suppress_capabilities", NULL, STRING, "3.0.0" } @@ -2890,7 +2890,7 @@ product version in the capabilities { "statuscache", 0, SWITCH, "2.3.17" } /* Enable/disable the imap status cache. */ -{ "statuscache_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), "3.1.6" } +{ "statuscache_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the imap status cache. */ { "statuscache_db_path", NULL, STRING, "2.5.0" } @@ -2906,7 +2906,7 @@ product version in the capabilities Default is 8192. If there are more than this many messages appended to the mailbox, generate a synthetic partial state and send that. */ -{ "sync_cache_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), "3.3.1" } +{ "sync_cache_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the replication cache. */ { "sync_cache_db_path", NULL, STRING, "3.3.1" } @@ -3067,7 +3067,7 @@ product version in the capabilities { "tls_ca_path", NULL, STRING, "2.5.0", "2.5.0", "tls_client_ca_dir" } /* Deprecated in favor of \fItls_client_ca_dir\fR. */ -{ "tlscache_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), "2.5.0", "2.5.0", "tls_sessions_db" } +{ "tlscache_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip"), "UNRELEASED", "2.5.0", "tls_sessions_db" } /* Deprecated in favor of \fItls_sessions_db\fR. */ { "tlscache_db_path", NULL, STRING, "2.5.0", "2.5.0", "tls_sessions_db_path" } @@ -3151,7 +3151,7 @@ product version in the capabilities public key. Two files with keys can be set, if two certificates are used, in which case the files must be separated with comma without spaces. */ -{ "tls_sessions_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip", "zeroskip"), "3.1.6" } +{ "tls_sessions_db", "twoskip", STRINGLIST("skiplist", "sql", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the TLS cache. */ { "tls_sessions_db_path", NULL, STRING, "2.5.0" } @@ -3181,7 +3181,7 @@ product version in the capabilities { "umask", "077", STRING, "2.3.17" } /* The umask value used by various Cyrus IMAP programs. */ -{ "userdeny_db", "flat", STRINGLIST("flat", "skiplist", "sql", "twoskip", "zeroskip"), "3.1.6" } +{ "userdeny_db", "flat", STRINGLIST("flat", "skiplist", "sql", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for the user access list. */ { "userdeny_db_path", NULL, STRING, "2.5.0" } @@ -3298,7 +3298,7 @@ of the incoming network interface, or if no record is found, the this user. NOTE: This must be an existing local user name with an INBOX, NOT an email address! */ -{ "zoneinfo_db", "twoskip", STRINGLIST("flat", "skiplist", "twoskip", "zeroskip"), "3.1.6" } +{ "zoneinfo_db", "twoskip", STRINGLIST("flat", "skiplist", "twoskip"), "UNRELEASED" } /* The cyrusdb backend to use for zoneinfo. This database is used by the "tzdist" \fIhttpmodules\fR, and is managed by \fBctl_zoneinfo(8)\fR.*/