Brian Rowe 79fb46456f Rename server to data node
The timescale clustering code so far has been written referring to the
remote databases as 'servers'.  This terminology is a bit overloaded,
and in particular we don't enforce any network topology limitations
that the term 'server' would suggest.  In light of this we've decided
to change to use the term 'node' when referring to the different
databases in a distributed database.  Specifically we refer to the
frontend as an 'access node' and to the backends as 'data nodes',
though we may omit the access or data qualifier where it's unambiguous.

As the vast bulk of the code so far has been written for the case where
there was a single access node, almost all instances of 'server' were
references to data nodes.  This change has updated the code to rename
those instances.
2020-05-27 17:31:09 +02:00
..
2020-05-18 20:16:03 -04:00
2018-02-28 00:03:14 +01:00
2018-02-28 10:55:43 -05:00
2018-09-28 13:26:28 -04:00
2018-10-18 15:45:53 -04:00
2019-01-28 20:47:04 -05:00
2019-02-08 19:11:09 -05:00
2019-03-14 14:32:27 +01:00
2019-05-07 02:47:13 +02:00
2019-07-17 18:23:13 +02:00
2020-05-18 20:16:03 -04:00
2019-11-12 12:42:43 +01:00
2020-01-15 18:20:30 +01:00
2020-03-13 18:07:24 +01:00
2020-04-16 17:42:36 +02:00
2020-05-27 17:31:09 +02:00

Extension updates

This directory contains "modfiles" (SQL scripts) with modifications that are applied when updating from one version of the extension to another.

The actual update scripts are compiled from modfiles by concatenating them with the current source code (which should come at the end of the resulting update script). Update scripts can "jump" several versions by using multiple modfiles in order. There are two types of modfiles:

  • Transition modfiles named <from>-<to>.sql, where from and to indicate the (adjacent) versions transitioning between. Transition modfiles are concatenated to form the lineage from an origin version to any later version.
  • Origin modfiles named .sql, which are included only in update scripts that origin at the particular version given in the name. So, for instance, 0.7.0.sql is only included in the script moving from 0.7.0 to the current version, but not in, e.g., the update script for 0.4.0 to the current version. These files typically contain fixes for bugs that are specific to the origin version, but are no longer present in the transition modfiles.

To ensure that this update process works, there are a few principles to consider.

  1. Modfiles should, in most cases, only contain ALTER or DROP commands that change or remove objects. In some cases, modifications of metadata are also necessary.
  2. DROP FUNCTION needs to be idempotent. In most cases that means commands should have an IF EXISTS clause. The reason is that some modfiles might try to, e.g., DROP functions that aren't present because they only exist in an intermediate version of the database, which is skipped over.
  3. Modfiles cannot rely on objects or functions that are present in a previous version of the extension. This is because a particular modfile should work when upgrading from any previous version of the extension, where those functions or objects aren't present yet.
  4. The creation of new metadata tables need to be part of modfiles, similar to ALTERs of such tables. Otherwise, later modfiles cannot rely on those tables being present.
  5. When creating a new aggregate, the CREATE statement should be added to both aggregate.sql AND an update file. aggregate.sql is run once when TimescaleDB is installed so adding a definition in an update file is the only way to ensure that upgrading users get the new function.

Notes on post_update.sql We use a special config var (timescaledb.update_script_stage ) to notify that dependencies have been setup and now timescaledb specific queries can be enabled. This is useful if we want to, for example, modify objects that need timescaledb specific syntax as part of the extension update). The scripts in post_update.sql are executed as part of the ALTER EXTENSION stmt.

Note that modfiles that contain no changes need not exist as a file. Transition modfiles must, however, be listed in the CMakeLists.txt file in the parent directory for an update script to be built for that version.