Skip to content

Commit

Permalink
Remove remote connection handling code
Browse files Browse the repository at this point in the history
Remove the code used by multinode to handle remote connections.
This patch completely removes tsl/src/remote and any remaining
distributed hypertable checks.
  • Loading branch information
svenklemm committed Dec 15, 2023
1 parent 3d8ec1e commit 6395b24
Show file tree
Hide file tree
Showing 106 changed files with 56 additions and 17,371 deletions.
5 changes: 0 additions & 5 deletions sql/cagg_utils.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ CREATE OR REPLACE FUNCTION _timescaledb_functions.materialization_invalidation_l
mat_hypertable_id INTEGER
) RETURNS VOID AS '@MODULE_PATHNAME@', 'ts_materialization_invalidation_log_delete' LANGUAGE C STRICT VOLATILE;

-- raw_hypertable_id - The hypertable ID of the original distributed hypertable in the Access Node
CREATE OR REPLACE FUNCTION _timescaledb_functions.drop_dist_ht_invalidation_trigger(
raw_hypertable_id INTEGER
) RETURNS VOID AS '@MODULE_PATHNAME@', 'ts_drop_dist_ht_invalidation_trigger' LANGUAGE C STRICT VOLATILE;

-- Processes the hypertable invalidation log in a data node for all the CAGGs that belong to the
-- distributed hypertable with hypertable ID 'raw_hypertable_id' in the Access Node. The
-- invalidations are cut, merged and moved to the materialization invalidation log.
Expand Down
10 changes: 0 additions & 10 deletions sql/compat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,6 @@ END$$
SET search_path TO pg_catalog,pg_temp;


CREATE OR REPLACE FUNCTION _timescaledb_internal.drop_dist_ht_invalidation_trigger(raw_hypertable_id integer) RETURNS void LANGUAGE PLPGSQL AS $$
BEGIN
IF current_setting('timescaledb.enable_deprecation_warnings', true)::bool THEN
RAISE WARNING 'function _timescaledb_internal.drop_dist_ht_invalidation_trigger(integer) is deprecated and has been moved to _timescaledb_functions schema. this compatibility function will be removed in a future version.';
END IF;
PERFORM _timescaledb_functions.drop_dist_ht_invalidation_trigger($1);
END$$
SET search_path TO pg_catalog,pg_temp;


-- We cannot create a wrapper function in plpgsql for the aggregate transition
-- functions because plpgsql cannot deal with datatype internal but since these
-- are used in an aggregation context and cannot be called directly and will
Expand Down
2 changes: 2 additions & 0 deletions sql/updates/latest-dev.sql
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ DROP PROCEDURE IF EXISTS timescaledb_experimental.cleanup_copy_chunk_operation;
DROP FUNCTION IF EXISTS _timescaledb_functions.set_chunk_default_data_node;
DROP FUNCTION IF EXISTS _timescaledb_internal.set_chunk_default_data_node;

DROP FUNCTION IF EXISTS _timescaledb_functions.drop_dist_ht_invalidation_trigger;
DROP FUNCTION IF EXISTS _timescaledb_internal.drop_dist_ht_invalidation_trigger;
3 changes: 3 additions & 0 deletions sql/updates/reverse-dev.sql
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,7 @@ AS '@MODULE_PATHNAME@', 'ts_copy_chunk_cleanup_proc' LANGUAGE C;
CREATE FUNCTION _timescaledb_functions.set_chunk_default_data_node(chunk REGCLASS, node_name NAME) RETURNS BOOLEAN
AS '@MODULE_PATHNAME@', 'ts_chunk_set_default_data_node' LANGUAGE C VOLATILE;

CREATE FUNCTION _timescaledb_functions.drop_dist_ht_invalidation_trigger(
raw_hypertable_id INTEGER
) RETURNS VOID AS '@MODULE_PATHNAME@', 'ts_drop_dist_ht_invalidation_trigger' LANGUAGE C STRICT VOLATILE;

21 changes: 0 additions & 21 deletions src/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,27 +204,6 @@ ts_cache_fetch(Cache *cache, CacheQuery *query)
return query->result;
}

bool
ts_cache_remove(Cache *cache, void *key)
{
bool found;

if (cache->remove_entry != NULL)
{
/* In case we want to free the removing entry we must do it beforehand
* because HASH_REMOVE call returns dangling pointer, which cannot be used */
void *entry = hash_search(cache->htab, key, HASH_FIND, &found);
if (found)
cache->remove_entry(entry);
}

hash_search(cache->htab, key, HASH_REMOVE, &found);
if (found)
cache->stats.numelements--;

return found;
}

static void
release_all_pinned_caches()
{
Expand Down
1 change: 0 additions & 1 deletion src/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ typedef struct Cache
extern TSDLLEXPORT void ts_cache_init(Cache *cache);
extern TSDLLEXPORT void ts_cache_invalidate(Cache *cache);
extern TSDLLEXPORT void *ts_cache_fetch(Cache *cache, CacheQuery *query);
extern TSDLLEXPORT bool ts_cache_remove(Cache *cache, void *key);
extern TSDLLEXPORT MemoryContext ts_cache_memory_ctx(Cache *cache);
extern TSDLLEXPORT Cache *ts_cache_pin(Cache *cache);
extern TSDLLEXPORT int ts_cache_release(Cache *cache);
Expand Down
25 changes: 0 additions & 25 deletions src/cache_invalidate.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,6 @@ cache_invalidate_relcache_callback(Datum arg, Oid relid)
}
}

/* Registration for given cache ids happens in non-TSL code when the extension
* is created.
*
* Cache entries get invalidated when either the foreign server entry or the
* role entry in the PostgreSQL catalog changes.
*
* When the foreign server entry changes, connection parameters might have
* changed. When the role entry changes, the certificate used for client
* authentication with backend data nodes might no longer be valid.
*/
static void
cache_invalidate_syscache_callback(Datum arg, int cacheid, uint32 hashvalue)
{
Assert(cacheid == FOREIGNSERVEROID || cacheid == AUTHOID);
ts_cm_functions->cache_syscache_invalidate(arg, cacheid, hashvalue);
}

TS_FUNCTION_INFO_V1(ts_timescaledb_invalidate_cache);

/*
Expand Down Expand Up @@ -183,14 +166,6 @@ _cache_invalidate_init(void)
RegisterXactCallback(cache_invalidate_xact_end, NULL);
RegisterSubXactCallback(cache_invalidate_subxact_end, NULL);
CacheRegisterRelcacheCallback(cache_invalidate_relcache_callback, PointerGetDatum(NULL));

/* Specific syscache callbacks */
CacheRegisterSyscacheCallback(FOREIGNSERVEROID,
cache_invalidate_syscache_callback,
PointerGetDatum(NULL));
CacheRegisterSyscacheCallback(AUTHOID,
cache_invalidate_syscache_callback,
PointerGetDatum(NULL));
}

void
Expand Down
Loading

0 comments on commit 6395b24

Please sign in to comment.