Skip to content

Commit 224d287

Browse files
committed
Remove ability to switch between snapshot implementations
Signed-off-by: mdouglas47 <[email protected]>
1 parent fb6837b commit 224d287

File tree

18 files changed

+3
-331
lines changed

18 files changed

+3
-331
lines changed

db/comdb2.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,6 @@ int gbl_enable_berkdb_retry_deadlock_bias = 0;
462462
int gbl_enable_cache_internal_nodes = 1;
463463
int gbl_use_modsnap_for_snapshot = 0;
464464
int gbl_modsnap_asof = 0;
465-
const snap_impl_enum gbl_snap_fallback_impl = SNAP_IMPL_MODSNAP;
466-
const snap_impl_enum gbl_snap_backup_fallback_impl = SNAP_IMPL_MODSNAP;
467-
snap_impl_enum gbl_snap_impl = SNAP_IMPL_MODSNAP;
468465
int gbl_rep_process_txn_time = 0;
469466
int gbl_utxnid_log = 1;
470467
int gbl_test_commit_lsn_map = 0;

db/comdb2.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3429,12 +3429,6 @@ enum { TCM_PARENT_DEADLOCK = 1, TCM_MAX = 1 };
34293429
/* tagged api big or little endian. */
34303430
enum { TAGGED_API_BIG_ENDIAN = 1, TAGGED_API_LITTLE_ENDIAN = 2 };
34313431

3432-
typedef enum {
3433-
SNAP_IMPL_ORIG,
3434-
SNAP_IMPL_NEW,
3435-
SNAP_IMPL_MODSNAP,
3436-
} snap_impl_enum;
3437-
34383432
extern int gbl_check_schema_change_permissions;
34393433

34403434
extern int gbl_support_datetime_in_triggers;

db/config.c

Lines changed: 3 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ extern int gbl_disable_new_snapshot;
5858
extern int gbl_server_admin_mode;
5959
extern int gbl_modsnap_asof;
6060
extern int gbl_use_modsnap_for_snapshot;
61-
extern const snap_impl_enum gbl_snap_fallback_impl;
62-
extern const snap_impl_enum gbl_snap_backup_fallback_impl;
63-
extern snap_impl_enum gbl_snap_impl;
6461

6562
int gbl_disable_access_controls;
6663

@@ -73,7 +70,6 @@ static int gbl_nogbllrl; /* don't load /bb/bin/comdb2*.lrl */
7370

7471
static int pre_read_option(char *, int);
7572
static int read_lrl_option(struct dbenv *, char *, struct read_lrl_option_type *, int, int *);
76-
static void fallback_from_snap_impl();
7773

7874
// clang-format off
7975
static struct option long_options[] = {
@@ -629,10 +625,6 @@ static struct dbenv *read_lrl_file_int(struct dbenv *dbenv, const char *lrlname,
629625

630626
/* process legacy options (we deferred them) */
631627

632-
if (gbl_disable_new_snapshot && (gbl_snap_impl == SNAP_IMPL_NEW)) {
633-
fallback_from_snap_impl();
634-
}
635-
636628
if (gbl_rowlocks) {
637629
/* We can't ever choose a writer as a deadlock victim in rowlocks mode
638630
(at least without some kludgery, or snapshots) */
@@ -719,110 +711,6 @@ static int new_table_from_schema(struct dbenv *dbenv, char *tblname,
719711
return 0;
720712
}
721713

722-
/*
723-
* Toggles the 'modsnap' snapshot implementation on and off.
724-
*
725-
* switch_val: 1 if toggling on and 0 if toggling off.
726-
*/
727-
static void toggle_modsnap(int switch_val) {
728-
gbl_use_modsnap_for_snapshot = switch_val;
729-
gbl_modsnap_asof = switch_val;
730-
}
731-
732-
/*
733-
* Toggles the 'new' snapshot implementation on and off.
734-
*
735-
* switch_val: 1 if toggling on and 0 if toggling off.
736-
*/
737-
static void toggle_new_snapisol(int switch_val) {
738-
gbl_new_snapisol = switch_val;
739-
gbl_new_snapisol_asof = switch_val;
740-
gbl_new_snapisol_logging = switch_val;
741-
}
742-
743-
/*
744-
* Prints a string representation of a `snap_impl_enum` type,
745-
* or "UNKNOWN" if the value passed in is not a valid `snap_impl_enum`.
746-
*
747-
* impl: The value to output as a string.
748-
*/
749-
const char *snap_impl_str(snap_impl_enum impl) {
750-
switch (impl) {
751-
case SNAP_IMPL_ORIG:
752-
return "ORIGINAL";
753-
break;
754-
case SNAP_IMPL_NEW:
755-
return "NEW";
756-
break;
757-
case SNAP_IMPL_MODSNAP:
758-
return "MODSNAP";
759-
break;
760-
default:
761-
return "UNKNOWN";
762-
break;
763-
}
764-
}
765-
766-
static const char * value_on_off(int switch_var) {
767-
const char * value = switch_var ? "ON" : "OFF";
768-
return value;
769-
}
770-
771-
void print_snap_config(loglvl lvl) {
772-
logmsg(lvl, "Snapshot is %s; "
773-
"Implementation set to '%s'; "
774-
"gbl_use_modsnap_for_snapshot=%s; "
775-
"gbl_modsnap_asof=%s; "
776-
"gbl_new_snapisol=%s; "
777-
"gbl_new_snapisol_asof=%s; "
778-
"gbl_new_snapisol_logging=%s\n",
779-
value_on_off(gbl_snapisol),
780-
snap_impl_str(gbl_snap_impl),
781-
value_on_off(gbl_use_modsnap_for_snapshot),
782-
value_on_off(gbl_modsnap_asof),
783-
value_on_off(gbl_new_snapisol),
784-
value_on_off(gbl_new_snapisol_asof),
785-
value_on_off(gbl_new_snapisol_logging));
786-
}
787-
788-
/*
789-
* Sets the snapshot implementation.
790-
*
791-
* impl: The implementation to be set.
792-
*/
793-
void set_snapshot_impl(snap_impl_enum impl) {
794-
gbl_snap_impl = impl;
795-
gbl_snap_impl == SNAP_IMPL_MODSNAP ? toggle_modsnap(1) : toggle_modsnap(0);
796-
gbl_snap_impl == SNAP_IMPL_NEW ? toggle_new_snapisol(1) : toggle_new_snapisol(0);
797-
}
798-
799-
/*
800-
* Determines what the fallback implementation should be for the current
801-
* snapshot implementation and switches to it.
802-
*/
803-
static void fallback_from_snap_impl() {
804-
const snap_impl_enum fallback_impl =
805-
gbl_snap_fallback_impl != gbl_snap_impl ? gbl_snap_fallback_impl : gbl_snap_backup_fallback_impl;
806-
807-
assert(fallback_impl != gbl_snap_impl);
808-
set_snapshot_impl(fallback_impl);
809-
}
810-
811-
/*
812-
* Enables snapshot isolation.
813-
*
814-
* dbenv: Parent environment.
815-
*/
816-
static void enable_snapshot(struct dbenv *dbenv) {
817-
if (gbl_snapisol) {
818-
return;
819-
}
820-
821-
set_snapshot_impl(gbl_snap_impl);
822-
bdb_attr_set(dbenv->bdb_attr, BDB_ATTR_SNAPISOL, 1);
823-
gbl_snapisol = 1;
824-
}
825-
826714
#define parse_lua_funcs(pfx) \
827715
do { \
828716
tok = segtok(line, strlen(line), &st, &ltok); \
@@ -1372,18 +1260,10 @@ static int read_lrl_option(struct dbenv *dbenv, char *line,
13721260
bdb_attr_set(dbenv->bdb_attr, BDB_ATTR_SNAPISOL, 1);
13731261
logmsg(LOGMSG_INFO, "Enabled logical logging\n");
13741262
} else if (tokcmp(tok, ltok, "enable_snapshot_isolation") == 0) {
1375-
enable_snapshot(dbenv);
1376-
} else if (tokcmp(tok, ltok, "enable_new_snapshot") == 0 ||
1377-
tokcmp(tok, ltok, "enable_new_snapshot_asof") == 0) {
1378-
set_snapshot_impl(SNAP_IMPL_NEW);
1379-
enable_snapshot(dbenv);
1380-
} else if (tokcmp(tok, ltok, "enable_new_snapshot_logging") == 0) {
13811263
bdb_attr_set(dbenv->bdb_attr, BDB_ATTR_SNAPISOL, 1);
1382-
gbl_new_snapisol_logging = 1;
1383-
logmsg(LOGMSG_INFO, "Enabled new snapshot logging\n");
1384-
} else if (tokcmp(tok, ltok, "disable_new_snapshot") == 0) {
1385-
gbl_disable_new_snapshot = 1;
1386-
logmsg(LOGMSG_INFO, "Disabled new snapshot\n");
1264+
gbl_snapisol = 1;
1265+
gbl_use_modsnap_for_snapshot = 1;
1266+
gbl_modsnap_asof = 1;
13871267
} else if (tokcmp(tok, ltok, "enable_serial_isolation") == 0) {
13881268
bdb_attr_set(dbenv->bdb_attr, BDB_ATTR_SNAPISOL, 1);
13891269
gbl_snapisol = 1;
@@ -1679,10 +1559,6 @@ static int read_lrl_option(struct dbenv *dbenv, char *line,
16791559
}
16801560
}
16811561

1682-
if (gbl_disable_new_snapshot && (gbl_snap_impl == SNAP_IMPL_NEW)) {
1683-
fallback_from_snap_impl();
1684-
}
1685-
16861562
if (gbl_rowlocks) {
16871563
/* We can't ever choose a writer as a deadlock victim in rowlocks mode
16881564
(at least without some kludgery, or snapshots) */

db/db_tunables.c

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ extern int gbl_udp;
172172
extern int gbl_update_delete_limit;
173173
extern int gbl_updategenids;
174174
extern int gbl_use_modsnap_for_snapshot;
175-
extern snap_impl_enum gbl_snap_impl;
176175
extern int gbl_use_node_pri;
177176
extern int gbl_watchdog_watch_threshold;
178177
extern int portmux_port;
@@ -595,9 +594,6 @@ extern int gbl_nonodh_queue_scan_limit;
595594
extern int gbl_sql_row_delay_msecs;
596595
extern int gbl_thread_wait_sec;
597596

598-
extern void set_snapshot_impl(snap_impl_enum impl);
599-
extern const char *snap_impl_str(snap_impl_enum impl);
600-
601597
int64_t gbl_driver_ulimit = 0;
602598

603599
int gbl_test_tunable_nozero = 1;
@@ -671,49 +667,6 @@ int percent_verify(void *unused, void *percent)
671667
return 0;
672668
}
673669

674-
struct snapshot_impl_config_st {
675-
const char *name;
676-
int code;
677-
} snapshot_impl_config_vals[] = {{"original", SNAP_IMPL_ORIG},
678-
{"new", SNAP_IMPL_NEW},
679-
{"modsnap", SNAP_IMPL_MODSNAP}};
680-
681-
static int snapshot_impl_update(void *context, void *value) {
682-
comdb2_tunable *tunable;
683-
char *tok;
684-
int st = 0;
685-
int ltok;
686-
int len;
687-
int rc;
688-
689-
tunable = (comdb2_tunable *)context;
690-
len = strlen(value);
691-
tok = segtok(value, len, &st, &ltok);
692-
rc = 0;
693-
694-
for (int i = 0; i < (sizeof(snapshot_impl_config_vals) /
695-
sizeof(struct snapshot_impl_config_st));
696-
i++) {
697-
if (tokcmp(tok, ltok, snapshot_impl_config_vals[i].name) == 0) {
698-
set_snapshot_impl(snapshot_impl_config_vals[i].code);
699-
goto found;
700-
}
701-
}
702-
703-
logmsg(LOGMSG_ERROR, "Invalid value '%s' for tunable '%s'\n", tok, tunable->name);
704-
rc = 1;
705-
706-
found:
707-
return rc;
708-
}
709-
710-
static void *snapshot_impl_value(void *context)
711-
{
712-
comdb2_tunable *tunable = (comdb2_tunable *)context;
713-
714-
return (void *) snap_impl_str(*(int *)tunable->var);
715-
}
716-
717670
struct enable_sql_stmt_caching_st {
718671
const char *name;
719672
int code;

db/db_tunables.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@ REGISTER_TUNABLE("disable_inplace_blobs", "Disables 'enable_inplace_blobs'",
232232
REGISTER_TUNABLE("disable_lowpri_snapisol", "Disables 'enable_lowpri_snapisol'",
233233
TUNABLE_BOOLEAN, &gbl_lowpri_snapisol_sessions,
234234
INVERSE_VALUE | READONLY | NOARG, NULL, NULL, NULL, NULL);
235-
/*
236-
REGISTER_TUNABLE("disable_new_snapshot",
237-
"Disables 'enable_new_snapshot'", TUNABLE_BOOLEAN,
238-
&gbl_new_snapisol, INVERSE_VALUE | READONLY | NOARG, NULL,
239-
NULL, NULL, NULL);
240-
*/
241235
REGISTER_TUNABLE("disable_osql_blob_optimization",
242236
"Disables 'enable_osql_blob_optimization'", TUNABLE_BOOLEAN,
243237
&gbl_osql_blob_optimization, INVERSE_VALUE | READONLY | NOARG,
@@ -461,22 +455,6 @@ REGISTER_TUNABLE("enable_lowpri_snapisol",
461455
"state. (Default: off)",
462456
TUNABLE_BOOLEAN, &gbl_lowpri_snapisol_sessions,
463457
READONLY | NOARG, NULL, NULL, NULL, NULL);
464-
465-
/*
466-
REGISTER_TUNABLE("enable_new_snapshot",
467-
"Enable new SNAPSHOT implementation. (Default: off)",
468-
TUNABLE_BOOLEAN, &gbl_new_snapisol, READONLY | NOARG, NULL,
469-
NULL, NULL, NULL);
470-
REGISTER_TUNABLE(
471-
"enable_new_snapshot_asof",
472-
"Enable new BEGIN TRANSACTION AS OF implementation. (Default: off)",
473-
TUNABLE_BOOLEAN, &gbl_new_snapisol_asof, READONLY | NOARG, NULL, NULL, NULL,
474-
NULL);
475-
REGISTER_TUNABLE("enable_new_snapshot_logging",
476-
"Enable alternate logging scheme. (Default: off)",
477-
TUNABLE_BOOLEAN, &gbl_new_snapisol_logging, READONLY | NOARG,
478-
NULL, NULL, NULL, NULL);
479-
*/
480458
REGISTER_TUNABLE("enable_osql_blob_optimization",
481459
"Replicant tracks which columns are modified in a transaction "
482460
"to allow blob updates to be ommitted if possible. (Default: "
@@ -511,11 +489,6 @@ REGISTER_TUNABLE("enable_serial_isolation",
511489
"the database. (Default: off)",
512490
TUNABLE_BOOLEAN, &gbl_serializable, NOARG | READONLY, NULL, NULL, NULL,
513491
NULL);
514-
REGISTER_TUNABLE("set_snapshot_impl",
515-
"Changes the default snapshot implementation "
516-
"*without enabling snapshot* (default 'modsnap')",
517-
TUNABLE_ENUM, &gbl_snap_impl, READEARLY | READONLY,
518-
snapshot_impl_value, NULL, snapshot_impl_update, NULL);
519492
REGISTER_TUNABLE("use_current_lsn_for_non_snapshot",
520493
"comdb2_snapshot_lsn provide current LSN if not using snapshot isolation. (Default: off)",
521494
TUNABLE_BOOLEAN, &gbl_use_current_lsn_for_non_snapshot, INTERNAL | EXPERIMENTAL, NULL, NULL, NULL,

db/process_message.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ static const char *HELP_STAT[] = {
222222
"stat mtrap - show mtrap system stats",
223223
"stat dohsql - show distributed sql stats",
224224
"stat oldfile - dump oldfile hash",
225-
"stat snapconfig - print snapshot configuration information",
226225
"dmpl - dump threads",
227226
"dmptrn - show long transaction stats",
228227
"dmpcts - show table constraints",
@@ -2007,8 +2006,6 @@ int process_command(struct dbenv *dbenv, char *line, int lline, int st)
20072006
oldfile_dump();
20082007
} else if (tokcmp(tok, ltok, "ssl") == 0) {
20092008
ssl_stats();
2010-
} else if (tokcmp(tok, ltok, "snapconfig") == 0) {
2011-
print_snap_config(LOGMSG_USER);
20122009
} else {
20132010
int rc = 1;
20142011
struct message_handler *h;

docs/pages/config/config_files.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,6 @@ These options are toggle-able at runtime.
805805
|disable_inplace_blob_optimization | | Disables enable_inplace_blob_optimization
806806
|disable_inplace_blobs | | Disables enable_inplace_blobs (needs enable_inplace_blob_optimization, and enable_osql_blob_optimization also enabled - which they are by default)
807807
|disable_lowpri_snapisol | |
808-
|disable_new_snapshot | | Disables alternate snapshot implementation
809808
|disable_osql_blob_optimization | | Disables disable_osql_blob_optimization
810809
|disable_overflow_page_trace | 1 | If set, warn when a page order table scan encounters an overflow page.
811810
|disable_page_latches | | Turns off page latches
@@ -828,9 +827,6 @@ These options are toggle-able at runtime.
828827
|enable_inplace_blob_optimization | | Enables inplace blob updates (blobs are updated in place in their b-tree when possible, not deleted/added)
829828
|enable_inplace_blobs | set | Don't update the rowid of a blob entry on an update
830829
|enable_lowpri_snapisol | 0 | Give lower priority to locks acquired when updating snapshot state
831-
|enable_new_snapshot | 0 | ***Experimental*** Enable new SNAPSHOT implementation
832-
|enable_new_snapshot_asof | 0 | ***Experimental*** Enable new BEGIN TRANSACTION AS OF implementation
833-
|enable_new_snapshot_logging | 0 | ***Experimental*** Enable alternate logging scheme
834830
|enable_osql_blob_optimization | set | Replicant tracks which columns are modified in a transaction to allow blob updates to be omitted if possible
835831
|enable_overflow_page_trace | | If set, don't warn when a page order table scan encounters an overflow page.
836832
|enable_pageorder_recsz_check | | Disables enable_pageorder_recsz_check

docs/pages/operating/op.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -919,10 +919,6 @@ Display key compression information.
919919

920920
Display root page cache information.
921921

922-
### stat snapconfig
923-
924-
Prints out snapshot configuration information.
925-
926922
### Other stats
927923

928924
Various other commands can also be run prepended with stat: [stax](#stax), [long](#long), [stal](#stal), [thr](#thr), [dmpl](#dmpl).

tests/siconfig.test/Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/siconfig.test/disable_newsi.testopts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)