Lots of things missing:
* only perform deadlock detection if there's blocked transactions on
the master
* only do the actual cycle detection for transactions that are blocked
* cancel member(s) of the cycle that are younger, to rpovide some
forward guarantee
* Fix bug requiring multiple cancel interrupts
* Proper error messages for cancelled transactions, that presumably
requires some hackery in our abort handler, overwriting the current
error?
* Test infrastructure, isolationtester unfortunately is unsuitable
* ...
This will be used, fat first, for distributed deadlock
detection. There it's important to be able to correlate transactions
on workers with transactions on the coordinator. For that distributed
transactions (ones that actually issue BEGIN on workers etc), get
assigned a distributed transaction ID. That ID currently consists out
of (nodeId, transactionNumber, timestamp).
TODO:
* think about 2PC
* locking
* query functionality
* ...
This commit is intended to be a base for supporting declarative partitioning
on distributed tables. Here we add the following utility functions and their
unit tests:
* Very basic functions including differnentiating partitioned tables and
partitions, listing the partitions
* Generating the PARTITION BY (expr) and adding this to the DDL events
of partitioned tables
* Ability to generate text representations of the ranges for partitions
* Ability to generate the `ALTER TABLE parent_table ATTACH PARTITION
partition_table FOR VALUES value_range`
* Ability to apply add shard ids to the above command using
`worker_apply_inter_shard_ddl_command()`
* Ability to generate `ALTER TABLE parent_table DETACH PARTITION`
Adds support for PostgreSQL 10 by copying in the requisite ruleutils
and updating all API usages to conform with changes in PostgreSQL 10.
Most changes are fairly minor but they are numerous. One particular
obstacle was the change in \d behavior in PostgreSQL 10's psql; I had
to add SQL implementations (views, mostly) to mimic the pre-10 output.
Add a second implementation of INSERT INTO distributed_table SELECT ... that is used if
the query cannot be pushed down. The basic idea is to execute the SELECT query separately
and pass the results into the distributed table using a CopyDestReceiver, which is also
used for COPY and create_distributed_table. When planning the SELECT, we go through
planner hooks again, which means the SELECT can also be a distributed query.
EXPLAIN is supported, but EXPLAIN ANALYZE is not because preventing double execution was
a lot more complicated in this case.
With this PR, we started to cache custom compiled PostgreSQL builds. If there
are no new commits to the related PostgreSQL branches, we will use already
compiled binaries to reduce testing time.