mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
Fix warnings for TSL licenses
So as to reduce the amount of logspam users receive, restrict printing license info to the following: 1. On CREATE EXTENSION a. in the notice, print the license expiration time, if any b. if the license is expired additionally print that c. else if the license will expire within a week print an addional warning 2. On the first usage of a TSL function, print if the license is expired or will be expired within a week
This commit is contained in:
parent
057eef1b8e
commit
fafc98d343
@ -1,6 +1,3 @@
|
||||
# Set version in the NOTICE file
|
||||
configure_file(notice.sql.in notice.sql)
|
||||
|
||||
set(INSTALL_FILE ${PROJECT_NAME}--${PROJECT_VERSION_MOD}.sql)
|
||||
|
||||
# Source files that define the schemas and tables for our metadata
|
||||
@ -18,10 +15,6 @@ set(IMMUTABLE_API_SOURCE_FILES
|
||||
aggregates.sql
|
||||
)
|
||||
|
||||
set(NOTICE_FILE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/notice.sql
|
||||
)
|
||||
|
||||
# The rest of the source files defining mostly functions
|
||||
set(SOURCE_FILES
|
||||
hypertable.sql
|
||||
@ -117,6 +110,7 @@ version_files("${IMMUTABLE_API_SOURCE_FILES}" IMMUTABLE_API_SOURCE_FILES_VERSION
|
||||
version_files("${SOURCE_FILES}" SOURCE_FILES_VERSIONED)
|
||||
version_files("${MOD_FILES}" MOD_FILES_VERSIONED)
|
||||
version_files("updates/latest-dev.sql" LASTEST_MOD_VERSIONED)
|
||||
version_files("notice.sql" NOTICE_FILE)
|
||||
|
||||
# Function to concatenate all files in SRC_FILE_LIST into file OUTPUT_FILE
|
||||
function(cat_files SRC_FILE_LIST OUTPUT_FILE)
|
||||
|
@ -11,3 +11,9 @@ AS '@MODULE_PATHNAME@', 'ts_current_license_key' LANGUAGE C STABLE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.tsl_loaded() RETURNS BOOLEAN
|
||||
AS '@MODULE_PATHNAME@', 'ts_tsl_loaded' LANGUAGE C STABLE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.license_expiration_time() RETURNS TIMESTAMPTZ
|
||||
AS '@MODULE_PATHNAME@', 'ts_license_expiration_time' LANGUAGE C STABLE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.print_license_expiration_info() RETURNS VOID
|
||||
AS '@MODULE_PATHNAME@', 'ts_print_tsl_license_expiration_info' LANGUAGE C STABLE;
|
||||
|
49
sql/notice.sql
Normal file
49
sql/notice.sql
Normal file
@ -0,0 +1,49 @@
|
||||
-- Copyright (c) 2016-2018 Timescale, Inc. All Rights Reserved.
|
||||
--
|
||||
-- This file is licensed under the Apache License, see LICENSE-APACHE
|
||||
-- at the top level directory of the TimescaleDB distribution.
|
||||
|
||||
DO language plpgsql $$
|
||||
DECLARE
|
||||
end_time TIMESTAMPTZ;
|
||||
expiration_time_string TEXT;
|
||||
BEGIN
|
||||
end_time := _timescaledb_internal.license_expiration_time();
|
||||
|
||||
IF end_time IS NOT NULL AND isfinite(end_time)
|
||||
THEN
|
||||
expiration_time_string = format(E'\nYour license expires on %s\n', end_time);
|
||||
ELSE
|
||||
expiration_time_string = '';
|
||||
END IF;
|
||||
|
||||
RAISE WARNING E'%\n%',
|
||||
E'\nWELCOME TO\n' ||
|
||||
E' _____ _ _ ____________ \n' ||
|
||||
E'|_ _(_) | | | _ \\ ___ \\ \n' ||
|
||||
E' | | _ _ __ ___ ___ ___ ___ __ _| | ___| | | | |_/ / \n' ||
|
||||
' | | | | _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \ ' || E'\n' ||
|
||||
' | | | | | | | | | __/\__ \ (_| (_| | | __/ |/ /| |_/ /' || E'\n' ||
|
||||
' |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/' || E'\n' ||
|
||||
E' Running version ' || '@PROJECT_VERSION_MOD@' || E'\n' ||
|
||||
|
||||
E'For more information on TimescaleDB, please visit the following links:\n\n'
|
||||
||
|
||||
E' 1. Getting started: https://docs.timescale.com/getting-started\n' ||
|
||||
E' 2. API reference documentation: https://docs.timescale.com/api\n' ||
|
||||
E' 3. How TimescaleDB is designed: https://docs.timescale.com/introduction/architecture\n\n' ||
|
||||
E'Note: TimescaleDB collects anonymous reports to better understand and assist our users.\nFor more information and how to disable, please see our docs https://docs.timescaledb.com/using-timescaledb/telemetry.',
|
||||
expiration_time_string;
|
||||
|
||||
IF now() > end_time
|
||||
THEN
|
||||
RAISE WARNING E'%\n', format('Your license expired on %s', end_time);
|
||||
ELSIF now() + INTERVAL '1 week' >= end_time
|
||||
THEN
|
||||
RAISE WARNING E'%\n', format('Your license will expires on %s', end_time);
|
||||
END IF;
|
||||
|
||||
END;
|
||||
$$;
|
||||
|
||||
select _timescaledb_internal.print_license_expiration_info();
|
@ -1,25 +0,0 @@
|
||||
-- Copyright (c) 2018 Timescale, Inc. All Rights Reserved.
|
||||
--
|
||||
-- This file is licensed under the Apache License,
|
||||
-- see LICENSE-APACHE at the top level directory of this distribution.
|
||||
|
||||
DO language plpgsql $$
|
||||
BEGIN
|
||||
RAISE WARNING '%',
|
||||
E'\nWELCOME TO\n' ||
|
||||
E' _____ _ _ ____________ \n' ||
|
||||
E'|_ _(_) | | | _ \\ ___ \\ \n' ||
|
||||
E' | | _ _ __ ___ ___ ___ ___ __ _| | ___| | | | |_/ / \n' ||
|
||||
' | | | | _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \ ' || E'\n' ||
|
||||
' | | | | | | | | | __/\__ \ (_| (_| | | __/ |/ /| |_/ /' || E'\n' ||
|
||||
' |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/' || E'\n' ||
|
||||
E' Running version ' || '@PROJECT_VERSION_MOD@' || E'\n' ||
|
||||
|
||||
E'For more information on TimescaleDB, please visit the following links:\n\n'
|
||||
||
|
||||
E' 1. Getting started: https://docs.timescale.com/getting-started\n' ||
|
||||
E' 2. API reference documentation: https://docs.timescale.com/api\n' ||
|
||||
E' 3. How TimescaleDB is designed: https://docs.timescale.com/introduction/architecture\n\n' ||
|
||||
E'Note: TimescaleDB collects anonymous reports to better understand and assist our users.\nFor more information and how to disable, please see our docs https://docs.timescaledb.com/using-timescaledb/telemetry.\n';
|
||||
END;
|
||||
$$;
|
@ -99,6 +99,13 @@ tsl_license_on_assign_default_fn(const char *newval, const void *license)
|
||||
error_no_default_fn_community();
|
||||
}
|
||||
|
||||
static TimestampTz
|
||||
license_end_time_default_fn(void)
|
||||
{
|
||||
error_no_default_fn_community();
|
||||
pg_unreachable();
|
||||
}
|
||||
|
||||
static void
|
||||
add_telemetry_default(JsonbParseState *parseState)
|
||||
{
|
||||
@ -145,6 +152,8 @@ TSDLLEXPORT CrossModuleFunctions ts_cm_functions_default = {
|
||||
.tsl_license_on_assign = tsl_license_on_assign_default_fn,
|
||||
.enterprise_enabled_internal = error_no_default_fn_bool_void_enterprise,
|
||||
.check_tsl_loaded = error_no_default_fn_bool_void_community,
|
||||
.license_end_time = license_end_time_default_fn,
|
||||
.print_tsl_license_expiration_info_hook = error_no_default_fn_community,
|
||||
.module_shutdown_hook = NULL,
|
||||
.add_tsl_license_info_telemetry = add_telemetry_default,
|
||||
.bgw_policy_job_execute = bgw_policy_job_execute_default_fn,
|
||||
|
@ -32,6 +32,8 @@ typedef struct CrossModuleFunctions
|
||||
void (*tsl_license_on_assign) (const char *newval, const void *license);
|
||||
bool (*enterprise_enabled_internal) (void);
|
||||
bool (*check_tsl_loaded) (void);
|
||||
TimestampTz (*license_end_time) (void);
|
||||
void (*print_tsl_license_expiration_info_hook) (void);
|
||||
void (*module_shutdown_hook) (void);
|
||||
void (*add_tsl_license_info_telemetry) (JsonbParseState *parseState);
|
||||
bool (*bgw_policy_job_execute) (BgwJob *job);
|
||||
|
@ -16,6 +16,8 @@
|
||||
TS_FUNCTION_INFO_V1(ts_enterprise_enabled);
|
||||
TS_FUNCTION_INFO_V1(ts_current_license_key);
|
||||
TS_FUNCTION_INFO_V1(ts_tsl_loaded);
|
||||
TS_FUNCTION_INFO_V1(ts_print_tsl_license_expiration_info);
|
||||
TS_FUNCTION_INFO_V1(ts_license_expiration_time);
|
||||
TS_FUNCTION_INFO_V1(ts_allow_downgrade_to_apache);
|
||||
|
||||
static bool downgrade_to_apache_enabled = false;
|
||||
@ -309,6 +311,23 @@ ts_current_license_key(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_TEXT_P(cstring_to_text(ts_guc_license_key));
|
||||
}
|
||||
|
||||
PGDLLEXPORT Datum
|
||||
ts_print_tsl_license_expiration_info(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (ts_cm_functions->print_tsl_license_expiration_info_hook != NULL)
|
||||
ts_cm_functions->print_tsl_license_expiration_info_hook();
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
PGDLLEXPORT Datum
|
||||
ts_license_expiration_time(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (ts_cm_functions->print_tsl_license_expiration_info_hook == NULL)
|
||||
PG_RETURN_NULL();
|
||||
|
||||
PG_RETURN_TIMESTAMPTZ(ts_cm_functions->license_end_time());
|
||||
}
|
||||
|
||||
/*
|
||||
* For testing purposes we occasionally need the ability to set the license to
|
||||
* Apache only. This function allows us to bypass the test that usually disables
|
||||
|
@ -49,6 +49,7 @@ drop_chunks_add_policy(PG_FUNCTION_ARGS)
|
||||
};
|
||||
|
||||
license_enforce_enterprise_enabled();
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
/* First verify that the hypertable corresponds to a valid table */
|
||||
if (!ts_is_hypertable(ht_oid))
|
||||
@ -100,6 +101,7 @@ drop_chunks_remove_policy(PG_FUNCTION_ARGS)
|
||||
BgwPolicyDropChunks *policy = ts_bgw_policy_drop_chunks_find_by_hypertable(ht_id);
|
||||
|
||||
license_enforce_enterprise_enabled();
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
if (policy == NULL)
|
||||
{
|
||||
|
@ -147,6 +147,7 @@ bool
|
||||
tsl_bgw_policy_job_execute(BgwJob *job)
|
||||
{
|
||||
license_enforce_enterprise_enabled();
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
switch (job->bgw_type)
|
||||
{
|
||||
@ -173,6 +174,7 @@ bgw_policy_alter_policy_schedule(PG_FUNCTION_ARGS)
|
||||
bool if_exists = PG_GETARG_BOOL(5);
|
||||
|
||||
license_enforce_enterprise_enabled();
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
/* First get the job */
|
||||
job = ts_bgw_job_find(job_id, CurrentMemoryContext, false);
|
||||
|
@ -80,6 +80,7 @@ reorder_add_policy(PG_FUNCTION_ARGS)
|
||||
};
|
||||
|
||||
license_enforce_enterprise_enabled();
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
/* First verify that the hypertable corresponds to a valid table */
|
||||
if (!ts_is_hypertable(ht_oid))
|
||||
@ -142,6 +143,7 @@ reorder_remove_policy(PG_FUNCTION_ARGS)
|
||||
BgwPolicyReorder *policy = ts_bgw_policy_reorder_find_by_hypertable(ht_id);
|
||||
|
||||
license_enforce_enterprise_enabled();
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
if (policy == NULL)
|
||||
{
|
||||
|
@ -7,11 +7,13 @@
|
||||
#include <fmgr.h>
|
||||
#include <utils/lsyscache.h>
|
||||
|
||||
#include "license.h"
|
||||
#include "gapfill/gapfill.h"
|
||||
|
||||
Datum
|
||||
gapfill_marker(PG_FUNCTION_ARGS)
|
||||
{
|
||||
license_print_expiration_warning_if_needed();
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("%s can only be used in an aggregation query with time_bucket_gapfill", get_func_name(fcinfo->flinfo->fn_oid))));
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <utils/lsyscache.h>
|
||||
#include <parser/parse_func.h>
|
||||
|
||||
#include "license.h"
|
||||
#include "gapfill/gapfill.h"
|
||||
#include "gapfill/planner.h"
|
||||
#include "gapfill/exec.h"
|
||||
@ -283,6 +284,8 @@ plan_add_gapfill(PlannerInfo *root,
|
||||
if (context.num_calls == 0)
|
||||
return;
|
||||
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
#ifndef HAVE_INT64_TIMESTAMP
|
||||
|
||||
/*
|
||||
|
@ -45,6 +45,8 @@ CrossModuleFunctions tsl_cm_functions = {
|
||||
.tsl_license_on_assign = tsl_license_on_assign,
|
||||
.enterprise_enabled_internal = enterprise_enabled_internal,
|
||||
.check_tsl_loaded = check_tsl_loaded,
|
||||
.license_end_time = license_end_time,
|
||||
.print_tsl_license_expiration_info_hook = license_print_expiration_info,
|
||||
.module_shutdown_hook = module_shutdown,
|
||||
.add_tsl_license_info_telemetry = tsl_telemetry_add_license_info,
|
||||
.bgw_policy_job_execute = tsl_bgw_policy_job_execute,
|
||||
|
@ -70,6 +70,8 @@ static const LicenseInfo community_license = {
|
||||
.enterprise_features_enabled = false
|
||||
};
|
||||
|
||||
static bool printed_license_expiration_warning = false;
|
||||
|
||||
|
||||
TS_FUNCTION_INFO_V1(tsl_license_update_check);
|
||||
|
||||
@ -304,19 +306,6 @@ void
|
||||
license_switch_to(const LicenseInfo *license)
|
||||
{
|
||||
Assert(license != NULL);
|
||||
|
||||
if (license_info_is_expired(license))
|
||||
{
|
||||
ereport(WARNING, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("Timescale License expired"),
|
||||
errhint("Your license expired on %s. Renew your license to continue using enterprise features.", DatumGetCString(DirectFunctionCall1(timestamptz_out, license->end_time)))));
|
||||
}
|
||||
else if (!TIMESTAMP_NOT_FINITE(license->end_time))
|
||||
{
|
||||
ereport(WARNING, (errcode(ERRCODE_WARNING),
|
||||
errmsg("your Timescale License expires on %s", DatumGetCString(DirectFunctionCall1(timestamptz_out, license->end_time)))));
|
||||
}
|
||||
|
||||
current_license = *license;
|
||||
}
|
||||
|
||||
@ -376,3 +365,43 @@ license_enforce_enterprise_enabled(void)
|
||||
if (!license_enterprise_enabled())
|
||||
elog(ERROR, "cannot execute an enterprise function with an invalid enterprise license");
|
||||
}
|
||||
|
||||
void
|
||||
license_print_expiration_info(void)
|
||||
{
|
||||
if (!TIMESTAMP_NOT_FINITE(current_license.end_time) && current_license.enterprise_features_enabled)
|
||||
{
|
||||
ereport(NOTICE, (errcode(ERRCODE_WARNING),
|
||||
errmsg("your Timescale Enterprise License expires on %s", DatumGetCString(DirectFunctionCall1(timestamptz_out, current_license.end_time)))));
|
||||
}
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
printed_license_expiration_warning = false;
|
||||
license_print_expiration_warning_if_needed();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
license_print_expiration_warning_if_needed(void)
|
||||
{
|
||||
if (printed_license_expiration_warning)
|
||||
return;
|
||||
|
||||
printed_license_expiration_warning = true;
|
||||
|
||||
if (license_is_expired())
|
||||
ereport(WARNING, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("Timescale License expired"),
|
||||
errhint("Your license expired on %s. Renew your license to continue using enterprise features.", DatumGetCString(DirectFunctionCall1(timestamptz_out, current_license.end_time)))));
|
||||
else
|
||||
{
|
||||
Interval week = {.day = 7,};
|
||||
TimestampTz warn_after = DatumGetTimestampTz(DirectFunctionCall2(timestamptz_mi_interval, TimestampTzGetDatum(current_license.end_time), IntervalPGetDatum(&week)));
|
||||
|
||||
if (timestamp_cmp_internal(GetCurrentTransactionStartTimestamp(), warn_after) >= 0)
|
||||
ereport(WARNING, (errcode(ERRCODE_WARNING),
|
||||
errmsg("your Timescale Enterprise License expires on %s", DatumGetCString(DirectFunctionCall1(timestamptz_out, current_license.end_time)))));
|
||||
}
|
||||
}
|
||||
|
@ -25,5 +25,7 @@ char *license_id_str(void);
|
||||
TimestampTz license_start_time(void);
|
||||
TimestampTz license_end_time(void);
|
||||
void license_enforce_enterprise_enabled(void);
|
||||
void license_print_expiration_info(void);
|
||||
void license_print_expiration_warning_if_needed(void);
|
||||
|
||||
#endif /* TIMESCALEDB_TSL_LICENSE_H */
|
||||
|
@ -60,6 +60,7 @@
|
||||
#include <hypertable_cache.h>
|
||||
#include <indexing.h>
|
||||
|
||||
#include "license.h"
|
||||
#include "reorder.h"
|
||||
|
||||
extern void timescale_reorder_rel(Oid tableOid, Oid indexOid, bool verbose, Oid wait_id);
|
||||
@ -103,6 +104,8 @@ tsl_reorder_chunk(PG_FUNCTION_ARGS)
|
||||
/* used for debugging purposes only see finish_heap_swaps */
|
||||
Oid wait_id = PG_NARGS() < 4 || PG_ARGISNULL(3) ? InvalidOid : PG_GETARG_OID(3);
|
||||
|
||||
license_print_expiration_warning_if_needed();
|
||||
|
||||
/*
|
||||
* Allow reorder in transactions for testing purposes only
|
||||
*/
|
||||
|
@ -4,7 +4,6 @@
|
||||
-- see LICENSE-TIMESCALE at the top of the tsl directory.
|
||||
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||
SELECT _timescaledb_internal.stop_background_workers();
|
||||
WARNING: Timescale License expired
|
||||
stop_background_workers
|
||||
-------------------------
|
||||
t
|
||||
@ -32,7 +31,6 @@ BEGIN
|
||||
return (count = 1);
|
||||
END
|
||||
$BODY$;
|
||||
WARNING: Timescale License expired
|
||||
CREATE FUNCTION check_index_oid(index_oid REGCLASS, hypertable_oid REGCLASS) RETURNS BOOLEAN LANGUAGE PLPGSQL AS
|
||||
$BODY$
|
||||
DECLARE
|
||||
@ -65,6 +63,7 @@ SELECT COUNT(*) FROM _timescaledb_catalog.chunk as c, _timescaledb_catalog.hyper
|
||||
-- Make sure reorder correctly selects chunks to reorder
|
||||
-- by starting with oldest chunks
|
||||
select add_reorder_policy('test_table', 'test_table_time_idx') as reorder_job_id \gset
|
||||
WARNING: Timescale License expired
|
||||
select * from _timescaledb_config.bgw_policy_reorder where job_id=:reorder_job_id;
|
||||
job_id | hypertable_id | hypertable_index_name
|
||||
--------+---------------+-----------------------
|
||||
|
@ -3,7 +3,6 @@
|
||||
-- This file is licensed under the Timescale License,
|
||||
-- see LICENSE-TIMESCALE at the top of the tsl directory.
|
||||
SELECT _timescaledb_internal.current_license_key();
|
||||
WARNING: Timescale License expired
|
||||
current_license_key
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
E1eyJlbmRfdGltZSI6IjIwMTgtMTAtMDEgKzAwMDAiLCAic3RhcnRfdGltZSI6IjIwMTgtMDktMDEgKzAwMDAiLCAiaWQiOiI0OTBGQjI2MC1BMjkyLTRBRDktOUFBMi0wMzYwODM1NzkxQjgiLCAia2luZCI6InRyaWFsIn0K
|
||||
@ -46,7 +45,6 @@ SELECT _timescaledb_internal.enterprise_enabled();
|
||||
\set ON_ERROR_STOP 1
|
||||
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||
SELECT _timescaledb_internal.current_license_key();
|
||||
WARNING: Timescale License expired
|
||||
current_license_key
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
E1eyJlbmRfdGltZSI6IjIwMTgtMTAtMDEgKzAwMDAiLCAic3RhcnRfdGltZSI6IjIwMTgtMDktMDEgKzAwMDAiLCAiaWQiOiI0OTBGQjI2MC1BMjkyLTRBRDktOUFBMi0wMzYwODM1NzkxQjgiLCAia2luZCI6InRyaWFsIn0K
|
||||
@ -106,7 +104,6 @@ SELECT _timescaledb_internal.enterprise_enabled();
|
||||
(1 row)
|
||||
|
||||
SET timescaledb.license_key=Default;
|
||||
WARNING: Timescale License expired
|
||||
SELECT _timescaledb_internal.current_license_key();
|
||||
current_license_key
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -4,7 +4,6 @@
|
||||
-- see LICENSE-TIMESCALE at the top of the tsl directory.
|
||||
\set EXPLAIN 'EXPLAIN (COSTS OFF)'
|
||||
CREATE TABLE gapfill_plan_test(time timestamptz NOT NULL, value float);
|
||||
WARNING: Timescale License expired
|
||||
SELECT table_name FROM create_hypertable('gapfill_plan_test','time',chunk_time_interval=>'4 weeks'::interval);
|
||||
table_name
|
||||
-------------------
|
||||
@ -20,6 +19,7 @@ SELECT
|
||||
FROM (VALUES (now(),1),(now(),NULL),(now(),NULL)) as t(time,c2)
|
||||
GROUP BY 1
|
||||
ORDER BY 1;
|
||||
WARNING: Timescale License expired
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------
|
||||
Custom Scan (GapFill)
|
||||
|
@ -4,7 +4,6 @@
|
||||
-- see LICENSE-TIMESCALE at the top of the tsl directory.
|
||||
\set EXPLAIN 'EXPLAIN (COSTS OFF)'
|
||||
CREATE TABLE gapfill_plan_test(time timestamptz NOT NULL, value float);
|
||||
WARNING: Timescale License expired
|
||||
SELECT table_name FROM create_hypertable('gapfill_plan_test','time',chunk_time_interval=>'4 weeks'::interval);
|
||||
table_name
|
||||
-------------------
|
||||
@ -20,6 +19,7 @@ SELECT
|
||||
FROM (VALUES (now(),1),(now(),NULL),(now(),NULL)) as t(time,c2)
|
||||
GROUP BY 1
|
||||
ORDER BY 1;
|
||||
WARNING: Timescale License expired
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------
|
||||
Custom Scan (GapFill)
|
||||
|
@ -4,7 +4,6 @@
|
||||
-- see LICENSE-TIMESCALE at the top of the tsl directory.
|
||||
\set EXPLAIN 'EXPLAIN (COSTS OFF)'
|
||||
CREATE TABLE gapfill_plan_test(time timestamptz NOT NULL, value float);
|
||||
WARNING: Timescale License expired
|
||||
SELECT table_name FROM create_hypertable('gapfill_plan_test','time',chunk_time_interval=>'4 weeks'::interval);
|
||||
table_name
|
||||
-------------------
|
||||
@ -20,6 +19,7 @@ SELECT
|
||||
FROM (VALUES (now(),1),(now(),NULL),(now(),NULL)) as t(time,c2)
|
||||
GROUP BY 1
|
||||
ORDER BY 1;
|
||||
WARNING: Timescale License expired
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------
|
||||
Custom Scan (GapFill)
|
||||
|
@ -3,7 +3,6 @@
|
||||
-- This file is licensed under the Timescale License,
|
||||
-- see LICENSE-TIMESCALE at the top of the tsl directory.
|
||||
CREATE TABLE cluster_test(time INTEGER, temp float, location int, value TEXT);
|
||||
WARNING: Timescale License expired
|
||||
SELECT create_hypertable('cluster_test', 'time', chunk_time_interval => 5);
|
||||
NOTICE: adding not-null constraint to column "time"
|
||||
create_hypertable
|
||||
@ -211,6 +210,7 @@ SELECT * FROM test.show_indexes('_timescaledb_internal._hyper_1_2_chunk');
|
||||
\set ON_ERROR_STOP 0
|
||||
-- cannot reorder a if with no index of the first call
|
||||
SELECT reorder_chunk('_timescaledb_internal._hyper_1_2_chunk', verbose => TRUE);
|
||||
WARNING: Timescale License expired
|
||||
ERROR: there is no previously clustered index for table "_hyper_1_2_chunk"
|
||||
\set ON_ERROR_STOP 1
|
||||
BEGIN;
|
||||
|
@ -4,7 +4,6 @@
|
||||
-- see LICENSE-TIMESCALE at the top of the tsl directory.
|
||||
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||
SELECT _timescaledb_internal.stop_background_workers();
|
||||
WARNING: Timescale License expired
|
||||
stop_background_workers
|
||||
-------------------------
|
||||
t
|
||||
@ -19,7 +18,6 @@ AS :TSL_MODULE_PATHNAME, 'ts_test_bgw_job_delete_by_id'
|
||||
LANGUAGE C VOLATILE STRICT;
|
||||
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
||||
select * from _timescaledb_config.bgw_policy_drop_chunks;
|
||||
WARNING: Timescale License expired
|
||||
job_id | hypertable_id | older_than | cascade
|
||||
--------+---------------+------------+---------
|
||||
(0 rows)
|
||||
@ -40,6 +38,7 @@ NOTICE: adding not-null constraint to column "time"
|
||||
CREATE INDEX second_index on test_table (time);
|
||||
CREATE INDEX third_index on test_table (time);
|
||||
select add_reorder_policy('test_table', 'test_table_time_idx') as job_id \gset
|
||||
WARNING: Timescale License expired
|
||||
-- Noop for duplicate policy
|
||||
select add_reorder_policy('test_table', 'test_table_time_idx', true);
|
||||
NOTICE: reorder policy already exists on hypertable "test_table", skipping
|
||||
@ -515,11 +514,9 @@ select job_id,chunk_id,num_times_job_run from _timescaledb_internal.bgw_policy_c
|
||||
|
||||
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||
TRUNCATE _timescaledb_internal.bgw_policy_chunk_stats;
|
||||
WARNING: Timescale License expired
|
||||
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
||||
-- Now test chunk_stat cascade deletion is correct
|
||||
select job_id,chunk_id,num_times_job_run from _timescaledb_internal.bgw_policy_chunk_stats;
|
||||
WARNING: Timescale License expired
|
||||
job_id | chunk_id | num_times_job_run
|
||||
--------+----------+-------------------
|
||||
(0 rows)
|
||||
@ -544,6 +541,7 @@ select c.id from _timescaledb_catalog.chunk as c, _timescaledb_catalog.hypertabl
|
||||
|
||||
select c.id as chunk_id from _timescaledb_catalog.chunk as c, _timescaledb_catalog.hypertable as h where c.hypertable_id=h.id and h.table_name='test_table' LIMIT 1 \gset
|
||||
select add_reorder_policy('test_table', 'second_index') as job_id \gset
|
||||
WARNING: Timescale License expired
|
||||
-- Simulate reorder job running and setting this stat row
|
||||
select ts_test_chunk_stats_insert(:job_id, :chunk_id, 1);
|
||||
ts_test_chunk_stats_insert
|
||||
@ -753,7 +751,6 @@ select remove_reorder_policy('test_table');
|
||||
|
||||
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||
set session timescaledb.license_key='Community';
|
||||
WARNING: Timescale License expired
|
||||
-- Now make sure everything fails in the Community (non-enterprise) edition
|
||||
\set ON_ERROR_STOP 0
|
||||
select add_reorder_policy('test_table', 'test_table_time_idx');
|
||||
|
@ -1,12 +1,4 @@
|
||||
Parsed test spec with 3 sessions
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
|
||||
starting permutation: S1 R1 Bc S2 Rc Sc
|
||||
step S1: SELECT * FROM ts_reorder_test;
|
||||
@ -15,6 +7,8 @@ time temp location
|
||||
1 23.4 1
|
||||
11 21.3 2
|
||||
21 19.5 3
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
step R1: SELECT reorder_chunk_i((SELECT show_chunks('ts_reorder_test') LIMIT 1), 'ts_reorder_test_time_idx', wait_on => 'waiter'); <waiting ...>
|
||||
step Bc: ROLLBACK;
|
||||
step S2: INSERT INTO ts_reorder_test VALUES (1, 23.4, 1);
|
||||
|
@ -1,17 +1,11 @@
|
||||
Parsed test spec with 3 sessions
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
|
||||
starting permutation: Bc I1 Ic R1 Rc
|
||||
step Bc: COMMIT;
|
||||
step I1: INSERT INTO ts_reorder_test VALUES (1, 19.5, 3);
|
||||
step Ic: COMMIT;
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
step R1: SELECT reorder_chunk_i((SELECT show_chunks('ts_reorder_test') LIMIT 1), 'ts_reorder_test_time_idx', wait_on => 'waiter');
|
||||
reorder_chunk_i
|
||||
|
||||
|
@ -1,14 +1,10 @@
|
||||
Parsed test spec with 2 sessions
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
|
||||
starting permutation: I1 Ic R1 Rc
|
||||
step I1: INSERT INTO ts_reorder_test VALUES (11, 19.5, 3);
|
||||
step Ic: COMMIT;
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
step R1: SELECT reorder_chunk_i((SELECT show_chunks('ts_reorder_test') LIMIT 1), 'ts_reorder_test_time_idx');
|
||||
reorder_chunk_i
|
||||
|
||||
|
@ -1,12 +1,4 @@
|
||||
Parsed test spec with 3 sessions
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
|
||||
starting permutation: Bc S1 Sc R1 Rc
|
||||
step Bc: COMMIT;
|
||||
@ -17,6 +9,8 @@ time temp location
|
||||
11 21.3 2
|
||||
21 19.5 3
|
||||
step Sc: COMMIT;
|
||||
WARNING: Timescale License expired
|
||||
HINT: Your license expired on Sun Sep 30 17:00:00 2018 PDT. Renew your license to continue using enterprise features.
|
||||
step R1: SELECT reorder_chunk_i((SELECT show_chunks('ts_reorder_test') LIMIT 1), 'ts_reorder_test_time_idx', wait_on => 'waiter');
|
||||
reorder_chunk_i
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user