Skip to content

Commit

Permalink
Remove experimental zeroskip database backend
Browse files Browse the repository at this point in the history
It never was ready for production use, is not distributed
anymore in cyruslibs and is not developed further.
  • Loading branch information
rsto committed Jan 8, 2025
1 parent ed755c1 commit ed44d60
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 684 deletions.
7 changes: 0 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions bench/cyrdbbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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;
}
Expand Down
14 changes: 14 additions & 0 deletions changes/next/remove-zeroskip
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 0 additions & 17 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2632,7 +2616,6 @@ Database support:
mysql: $with_mysql
postgresql: $use_pgsql
sqlite: $use_sqlite
zeroskip: $with_zeroskip

Search engine:
squat: $enable_squat
Expand Down
11 changes: 1 addition & 10 deletions cunit/aaa-db.testc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -190,15 +190,6 @@ static char *make_basedir(const char * const *reldirs)

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;
}

Expand Down
4 changes: 0 additions & 4 deletions cunit/conversations.testc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
16 changes: 1 addition & 15 deletions cunit/libconfig.testc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -994,20 +994,6 @@ static void test_deprecated_stringlist(void)
val = config_getstring(IMAPOPT_TLS_SESSIONS_DB);
CU_ASSERT_PTR_NOT_NULL(val);
CU_ASSERT_STRING_EQUAL(val, "sql");

/* set both names to different values */
CU_SYSLOG_MATCH("Option '.*' is deprecated");
config_read_string(
"configdirectory: "DBDIR"/conf\n"
"tlscache_db: sql\n"
"tls_sessions_db: zeroskip\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");
}

static void test_deprecated_duration(void)
Expand Down
2 changes: 1 addition & 1 deletion docsrc/imap/concepts/deployment/databases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ This is either cyrus.squat in each folder, or if you're using Xapian a single
<userid>.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
Expand Down
4 changes: 0 additions & 4 deletions lib/cyrusdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
Expand Down
Loading

0 comments on commit ed44d60

Please sign in to comment.