gayyappan 4f865f7870 Add recompress_chunk function
After inserts go into a compressed chunk, the chunk is marked as
unordered.This PR adds a new function recompress_chunk that
compresses the data and sets the status back to compressed. Further
optimizations for this function are planned but not part of this PR.

This function can be invoked by calling
SELECT recompress_chunk(<chunk_name>).

recompress_chunk function is automatically invoked by the compression
policy job, when it sees that a chunk is in unordered state.
2021-05-24 18:03:47 -04:00
..
2021-05-24 18:03:47 -04:00
2021-05-24 18:03:47 -04:00
2020-05-27 17:31:09 +02:00
2020-08-10 18:00:51 -04:00
2020-10-21 15:03:32 +02:00
2020-08-03 22:33:54 +02:00
2021-05-24 18:03:47 -04:00
2020-04-14 23:12:15 +02:00

Submodule Licensing and Initialization

Loading and Activation

We link module loading and activation to the license GUC itself. We have a single GUC, the license, and load submodules based on what capabilities the license enables, i.e., an apache license-key does not load this module, while timescale key does. This ensures that the loader "does the right thing" with respect to the license, and a user cannot accidentally activate features they aren't licensed to use.

The actual loading and activation is done through check and assign hooks on the license GUC. On check we validate the license type and on assign we set the capabilities-struct in this module, if needed. The check and assign functions can be found in license_guc.c/h in the Apache-Licensed src.

Cross License Functions

To enable binaries which only contain Apache-Licensed code, we dynamically link in Timescale-Licensed code on license activation, and handle all function calls into the module via function pointers.

The registry in ts_cm_functions of type CrossModuleFunctions (declared in cross_module_fn.h and defined in cross_module_fn.c) stores all of the cross-module functions.

To add a new cross-module function you must:

  • Add a struct member CrossModuleFunctions.<function name>.
  • Add default function to ts_cm_functions_default that will be called from the Apache version, usually this function should just call error_no_default_fn. NOTE Due to function-pointer casting rules, the default function must have the exact same signature as the function pointer; you may not cast another function pointer of another type.
  • Add the overriding function to tsl_cm_functionsin init.c in this module.

To call a cross-module functions use ts_cm_functions-><function name>(args).