Skip to content

Commit

Permalink
[YottaDB#218] Implement ydb_app_ensures_isolation env var to specify …
Browse files Browse the repository at this point in the history
…list of global variable names where application design ensures isolation
  • Loading branch information
nars1 committed Apr 30, 2018
1 parent 6a5f0b2 commit a3722dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sr_port/gtm_env_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
#include "tp.h"
#include "cli.h"
#include "repl_filter.h"
#include "ydb_getenv.h"
#include "op.h"

#define NOISOLATION_LITERAL "NOISOLATION"

#ifdef DEBUG
# define INITIAL_DEBUG_LEVEL GDL_Simple
Expand Down Expand Up @@ -96,6 +100,7 @@ void gtm_env_init(void)
uint4 tdbglvl, tmsock, reservesize, memsize, cachent, trctblsize, trctblbytes;
uint4 max_threads, max_procs;
int4 temp_strpllim;
char *ptr;
DCL_THREADGBL_ACCESS;

SETUP_THREADGBL_ACCESS;
Expand Down Expand Up @@ -381,6 +386,19 @@ void gtm_env_init(void)
ydb_repl_filter_timeout = REPL_FILTER_TIMEOUT_MAX;
assert((REPL_FILTER_TIMEOUT_MIN <= ydb_repl_filter_timeout)
&& (REPL_FILTER_TIMEOUT_MAX >= ydb_repl_filter_timeout));
/* See if ydb_noisolation is specified */
if (NULL != (ptr = ydb_getenv(YDBENVINDX_APP_ENSURES_ISOLATION, NULL_SUFFIX, NULL_IS_YDB_ENV_MATCH)))
{ /* Call the VIEW "NOISOLATION" command with the contents of the <ydb_app_ensures_isolation> env var */
mval noiso_lit, gbllist;

noiso_lit.mvtype = MV_STR;
noiso_lit.str.len = STR_LIT_LEN(NOISOLATION_LITERAL);
noiso_lit.str.addr = NOISOLATION_LITERAL;
gbllist.mvtype = MV_STR;
gbllist.str.len = STRLEN(ptr);
gbllist.str.addr = ptr;
op_view(VARLSTCNT(2) &noiso_lit, &gbllist);
}
/* Platform specific initializations */
gtm_env_init_sp();
}
Expand Down
1 change: 1 addition & 0 deletions sr_port/ydb_logicals_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
YDBENVINDX_TABLE_ENTRY (YDBENVINDX_MIN_INDEX, "", "")

YDBENVINDX_TABLE_ENTRY (YDBENVINDX_AIO_NR_EVENTS, "$ydb_aio_nr_events", "$gtm_aio_nr_events")
YDBENVINDX_TABLE_ENTRY (YDBENVINDX_APP_ENSURES_ISOLATION, "$ydb_app_ensures_isolation", "")
YDBENVINDX_TABLE_ENTRY (YDBENVINDX_AUTORELINK_CTLMAX, "$ydb_autorelink_ctlmax", "$gtm_autorelink_ctlmax")
YDBENVINDX_TABLE_ENTRY (YDBENVINDX_AUTORELINK_KEEPRTN, "$ydb_autorelink_keeprtn", "$gtm_autorelink_keeprtn")
YDBENVINDX_TABLE_ENTRY (YDBENVINDX_AUTORELINK_SHM, "$ydb_autorelink_shm", "$gtm_autorelink_shm")
Expand Down

0 comments on commit a3722dc

Please sign in to comment.