Skip to content

Commit

Permalink
Revert "tunable to disable tag writes"
Browse files Browse the repository at this point in the history
This reverts commit e0e6d10.
  • Loading branch information
akshatsikarwar committed Sep 13, 2024
1 parent 589ca8f commit c586215
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 48 deletions.
1 change: 0 additions & 1 deletion db/comdb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ pthread_rwlock_t thedb_lock = PTHREAD_RWLOCK_INITIALIZER;
int gbl_malloc_regions = 1;
int gbl_rowlocks = 0;
int gbl_disable_tagged_api = 1;
int gbl_disable_tagged_api_writes = 1;
int gbl_snapisol = 0;
int gbl_new_snapisol = 0;
int gbl_new_snapisol_asof = 0;
Expand Down
1 change: 0 additions & 1 deletion db/comdb2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3265,7 +3265,6 @@ void berkdb_use_malloc_for_regions_with_callbacks(void *mem,

extern int gbl_rowlocks;
extern int gbl_disable_tagged_api;
extern int gbl_disable_tagged_api_writes;
extern int gbl_snapisol;
extern int gbl_new_snapisol;
extern int gbl_new_snapisol_logging;
Expand Down
3 changes: 0 additions & 3 deletions db/db_tunables.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,6 @@ REGISTER_TUNABLE("disable_sql_dlmalloc",
REGISTER_TUNABLE("disable_tagged_api", "Disables 'enable_tagged_api'",
TUNABLE_BOOLEAN, &gbl_disable_tagged_api, NOARG, NULL, NULL,
NULL, NULL);
REGISTER_TUNABLE("disable_tagged_api_writes", "Disables tag api writes",
TUNABLE_BOOLEAN, &gbl_disable_tagged_api_writes, NOARG, NULL, NULL,
NULL, NULL);
REGISTER_TUNABLE("disable_temptable_pool", "Sets 'temptable_limit' to 0.",
TUNABLE_BOOLEAN, &gbl_temptable_pool_capacity,
INVERSE_VALUE | READONLY | NOARG, NULL, NULL, NULL, NULL);
Expand Down
6 changes: 0 additions & 6 deletions db/toblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -3125,12 +3125,6 @@ static int toblock_main_int(struct javasp_trans_state *javasp_trans_handle, stru
gbl_blockop_name_xrefs[opnum]);
}
}
if (!got_osql && gbl_disable_tagged_api_writes) {
logmsg(LOGMSG_ERROR, "Rejecting tagged api request\n");
outrc = ERR_BADREQ;
fromline = __LINE__;
goto cleanup;
}
} else {
have_blkseq = iq->have_blkseq;
}
Expand Down
5 changes: 0 additions & 5 deletions sqlite/src/comdb2build.c
Original file line number Diff line number Diff line change
Expand Up @@ -7554,11 +7554,6 @@ void comdb2CreateTimePartition(Parse* pParse, Token* period, Token* retention,
return;
}

if (!gbl_disable_tagged_api || !gbl_disable_tagged_api_writes) {
setError(pParse, SQLITE_ABORT, "Cannot create partition if tags enabled");
return;
}

partition = _get_partition(pParse, 0);
if (!partition)
return;
Expand Down
2 changes: 0 additions & 2 deletions tests/timepart_trunc.test/run.log.alpha
Original file line number Diff line number Diff line change
Expand Up @@ -1122,5 +1122,3 @@ cdb2sql ${CDB2_OPTIONS} --host MASTER dorintdb default select name, arg1, arg2,
(out='table $2_91201505 sz 64.00KB 1% (dta 64.00KB) partition teststatsize')
TEST 17
Test REBUILD partition
TEST 18
Test block alter
30 changes: 1 addition & 29 deletions tests/timepart_trunc.test/runit
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ $cmd "select * from comdb2_tables where tablename='t17'" >> $OUT 2>&1
echo $cmd "select * from comdb2_timepartshards where name='t17'"
$cmd "select * from comdb2_timepartshards where name='t17'" >> $OUT 2>&1


echo $cmd "create table teststatsize(a int)"
$cmd "create table teststatsize(a int)" >> $OUT 2>&1

Expand All @@ -548,35 +549,6 @@ if (( $? != 0 )) ; then
exit 1
fi

header 18 "Test block alter"
echo $cmd "create table t19(a int)"
$cmd "create table t19(a int)"
if (( $? != 0 )) ; then
echo "FAILURE to create table t19"
exit 1
fi

echo $cmd "put tunable disable_tagged_api_writes 0"
$cmd "put tunable disable_tagged_api_writes 0"
if (( $? != 0 )) ; then
echo "FAILURE to put tunable to 0"
exit 1
fi

echo $cmd "ALTER TABLE t19 PARTITIONED BY TIME PERIOD 'daily' RETENTION 3 start '2024-01-01T'"
$cmd "ALTER TABLE t19 PARTITIONED BY TIME PERIOD 'daily' RETENTION 3 start '2024-01-01T'"
if (( $? == 0 )) ; then
echo "FAILURE to block alter partition when tag writes are enabled"
exit 1
fi

echo $cmd "put tunable disable_tagged_api_writes 1"
$cmd "put tunable disable_tagged_api_writes 1"
if (( $? != 0 )) ; then
echo "FAILURE to put tunable to 1"
exit 1
fi

# we need to scrub dbname from alpha
sed "s/dorintdb/$dbname/g; s#\${CDB2_OPTIONS}#${CDB2_OPTIONS}#g" $OUT.alpha > $OUT.alpha.actual

Expand Down
1 change: 0 additions & 1 deletion tests/tunables.test/t00_all_tunables.expected
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
(name='disable_sql_dlmalloc', description='If set, will use default system malloc for SQL state machines. By default, each thread running SQL gets a dedicated memory pool. (Default: off)', type='BOOLEAN', value='OFF', read_only='Y')
(name='disable_stable_for_ipu', description='For inplace update tables, disable stable find-next cursors', type='BOOLEAN', value='ON', read_only='N')
(name='disable_tagged_api', description='Disables 'enable_tagged_api'', type='BOOLEAN', value='ON', read_only='N')
(name='disable_tagged_api_writes', description='Disables tag api writes', type='BOOLEAN', value='ON', read_only='N')
(name='disable_temptable_pool', description='Sets 'temptable_limit' to 0.', type='BOOLEAN', value='OFF', read_only='Y')
(name='disable_tpsc_tblvers', description='Disable table version checks for time partition schema changes', type='BOOLEAN', value='OFF', read_only='N')
(name='disable_update_shadows', description='stub out update shadows code', type='BOOLEAN', value='OFF', read_only='N')
Expand Down

0 comments on commit c586215

Please sign in to comment.