Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling queue-odh for multimeta #5001

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions db/comdb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,19 @@ static inline int db_get_alias(void *tran, dbtable *tbl)
return 0;
}

static void init_static_table(struct dbenv *dbenv)
{
/* Initialize static table once */
if (dbenv->static_table.dbs_idx != 0)
return;
/* Initialize static table once */
logmsg(LOGMSG_INFO, "%s initializing static table '%s'\n", __func__, COMDB2_STATIC_TABLE);
dbenv->static_table.dbs_idx = -1;
dbenv->static_table.tablename = COMDB2_STATIC_TABLE;
dbenv->static_table.dbenv = dbenv;
dbenv->static_table.dbtype = DBTYPE_TAGGED_TABLE;
dbenv->static_table.handle = dbenv->bdb_env;
}

/* gets the table names and dbnums from the low level meta table and sets up the
* dbenv accordingly. returns 0 on success and anything else otherwise */
Expand All @@ -2297,17 +2310,7 @@ static int llmeta_load_tables(struct dbenv *dbenv, void *tran)
/* set generic settings, likely already set when env was opened, but make
* sure */
bdb_attr_set(dbenv->bdb_attr, BDB_ATTR_GENIDS, 1);

/* Initialize static table once */
if (dbenv->static_table.dbs_idx == 0) {
logmsg(LOGMSG_INFO, "%s initializing static table '%s'\n", __func__,
COMDB2_STATIC_TABLE);
dbenv->static_table.dbs_idx = -1;
dbenv->static_table.tablename = COMDB2_STATIC_TABLE;
dbenv->static_table.dbenv = dbenv;
dbenv->static_table.dbtype = DBTYPE_TAGGED_TABLE;
dbenv->static_table.handle = dbenv->bdb_env;
}
init_static_table(dbenv);

/* make room for dbs */
dbenv->dbs = realloc(dbenv->dbs, fndnumtbls * sizeof(dbtable *));
Expand Down Expand Up @@ -4220,6 +4223,8 @@ static int init(int argc, char **argv)

if (gbl_create_mode) {
create_service_file(lrlname);
if (!gbl_init_single_meta)
init_static_table(thedb);
}

/* open db engine */
Expand Down
5 changes: 5 additions & 0 deletions db/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4101,6 +4101,11 @@ int backend_open_tran(struct dbenv *dbenv, tran_type *tran, uint32_t flags)
logmsg(LOGMSG_ERROR, "meta database not available\n");
}
}

/* disable these queuedb tunables that require singlemeta */
gbl_init_with_queue_odh = 0;
gbl_init_with_queue_compr = 0;
gbl_init_with_queue_persistent_seq = 0;
}

/* now that meta is open, get the blobstripe conversion genids for each
Expand Down
5 changes: 5 additions & 0 deletions tests/queuedb_multimeta.test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ifeq ($(TESTSROOTDIR),)
include ../testcase.mk
else
include $(TESTSROOTDIR)/testcase.mk
endif
9 changes: 9 additions & 0 deletions tests/queuedb_multimeta.test/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[CREATE TABLE t1 (a INTEGER)] rc 0
(filename='_comdb2_static_table.metalite.dta')
(filename='sqlite_stat1.metalite.dta')
(filename='sqlite_stat4.metalite.dta')
(filename='t1.metalite.dta')
[SELECT DISTINCT filename FROM comdb2_files WHERE filename LIKE '%metalite%'] rc 0
[CREATE DEFAULT LUA CONSUMER q1 ON (TABLE t1 FOR INSERT)] rc 0
(name='q1')
[SELECT name FROM comdb2_procedures] rc 0
2 changes: 2 additions & 0 deletions tests/queuedb_multimeta.test/lrl.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logmsg level info
singlemeta 0
13 changes: 13 additions & 0 deletions tests/queuedb_multimeta.test/runit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

bash -n "$0" | exit 1
dbnm=$1

cdb2sql ${CDB2_OPTIONS} $dbnm default - >actual <<EOF
CREATE TABLE t1 (a INTEGER)\$\$
SELECT DISTINCT filename FROM comdb2_files WHERE filename LIKE '%metalite%'
CREATE DEFAULT LUA CONSUMER q1 ON (TABLE t1 FOR INSERT)
SELECT name FROM comdb2_procedures
EOF

diff actual expected