Remove unused function

Remove unused function `invalidation_threshold_htid_found`.
This commit is contained in:
Fabrízio de Royes Mello 2023-04-04 17:31:33 -03:00
parent 1fb058b199
commit 6440bb3477
2 changed files with 0 additions and 60 deletions

View File

@ -214,65 +214,6 @@ invalidation_threshold_get(int32 hypertable_id)
return threshold;
}
static ScanTupleResult
invalidation_threshold_htid_found(TupleInfo *tinfo, void *data)
{
if (tinfo->lockresult != TM_Ok)
{
ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
errmsg("could not acquire lock for invalidation threshold row %d",
tinfo->lockresult),
errhint("Retry the operation again.")));
}
return SCAN_DONE;
}
/* lock row corresponding to hypertable id in
* continuous_aggs_invalidation_threshold table in AccessExclusive mode,
* block till lock is acquired.
*/
void
invalidation_threshold_lock(int32 raw_hypertable_id)
{
ScanTupLock scantuplock = {
.waitpolicy = LockWaitBlock,
.lockmode = LockTupleExclusive,
};
Catalog *catalog = ts_catalog_get();
ScanKeyData scankey[1];
int retcnt = 0;
ScannerCtx scanctx;
ScanKeyInit(&scankey[0],
Anum_continuous_aggs_invalidation_threshold_pkey_hypertable_id,
BTEqualStrategyNumber,
F_INT4EQ,
Int32GetDatum(raw_hypertable_id));
/* lock table in AccessShare mode and the row with AccessExclusive */
scanctx = (ScannerCtx){ .table = catalog_get_table_id(catalog,
CONTINUOUS_AGGS_INVALIDATION_THRESHOLD),
.index = catalog_get_index(catalog,
CONTINUOUS_AGGS_INVALIDATION_THRESHOLD,
CONTINUOUS_AGGS_INVALIDATION_THRESHOLD_PKEY),
.nkeys = 1,
.scankey = scankey,
.limit = 1,
.tuple_found = invalidation_threshold_htid_found,
.lockmode = AccessShareLock,
.scandirection = ForwardScanDirection,
.result_mctx = CurrentMemoryContext,
.tuplock = &scantuplock };
retcnt = ts_scanner_scan(&scanctx);
if (retcnt > 1)
{
ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
errmsg("found multiple invalidation rows for hypertable %d", raw_hypertable_id)));
}
}
/*
* Compute a new invalidation threshold.
*

View File

@ -14,7 +14,6 @@ typedef struct ContinuousAgg ContinuousAgg;
extern int64 invalidation_threshold_get(int32 hypertable_id);
extern int64 invalidation_threshold_set_or_get(int32 raw_hypertable_id,
int64 invalidation_threshold);
extern void invalidation_threshold_lock(int32 raw_hypertable_id);
extern int64 invalidation_threshold_compute(const ContinuousAgg *cagg,
const InternalTimeRange *refresh_window);