Commit Graph

402 Commits (601e9431dc30ada92815c70c2339082f997f7583)

Author SHA1 Message Date
Brian Cloutier 5166319f0e Add a test for upgrading shard placements 2017-07-12 14:18:27 +02:00
Brian Cloutier 86ce70a220 Rename pg_dist_shard_placement -> pg_dist_placement
Comes with a few changes:

- Change the signature of some functions to accept groupid
  - InsertShardPlacementRow
  - DeleteShardPlacementRow
  - UpdateShardPlacementState

- NodeHasActiveShardPlacements returns true if the group the node is a
  part of has any active shard placements

- TupleToShardPlacement now returns ShardPlacements which have NULL
  nodeName and nodePort.

- Populate (nodeName, nodePort) when creating ShardPlacements
- Disallow removing a node if it contains any shard placements

- DeleteAllReferenceTablePlacementsFromNode matches based on group. This
  doesn't change behavior for now (while there is only one node per
  group), but means in the future callers should be careful about
  calling it on a secondary node, it'll delete placements on the primary.

- Create concept of a GroupShardPlacement, which represents an actual
  tuple in pg_dist_placement and is distinct from a ShardPlacement,
  which has been resolved to a specific node. In the future
  ShardPlacement should be renamed to NodeShardPlacement.

- Create some triggers which allow existing code to continue to insert
  into and update pg_dist_shard_placement as if it still existed.
2017-07-12 14:17:31 +02:00
Brian Cloutier 74511748c6 Remove functions created just for unit testing
These functions are holdovers from pg_shard and were created for unit
testing c-level functions (like InsertShardPlacementRow) which our
regression tests already test quite effectively. Removing because it
makes refactoring the signatures of those c-level functions
unnecessarily difficult.

- create_healthy_local_shard_placement_row
- update_shard_placement_row_state
- delete_shard_placement_row
2017-07-12 14:16:24 +02:00
Brian Cloutier 405bd91978 Ignore generated multi_behavioral_analytics_create_table test files 2017-07-12 14:16:24 +02:00
Marco Slot e0c960e248 Use consistent placement IDs in mulity_modyfing_xactstest 2017-07-12 14:16:23 +02:00
Brian Cloutier 0d0235cad5 Remove unused line, @arguments was set but never used 2017-07-12 13:46:27 +02:00
Marco Slot aeca4b7a11 Clarify placement connection error messages 2017-07-12 11:59:19 +02:00
Marco Slot b7a935b282 Remove XactModificationLevel distinction between DML and multi-shard 2017-07-12 11:59:19 +02:00
Jason Petersen a7317564ea Add some test outputs to gitignore
These were bothering me.
2017-07-11 15:37:32 -06:00
Burak Yucesoy 33c2c97c6a Add tests for concurrent INSERT and VACUUM behaviour 2017-07-10 15:46:48 +03:00
Marco Slot e2091ae96a Handle implicit casts in prepared INSERTs 2017-07-06 16:17:35 +02:00
Andres Freund 13b86623fd Add tests for statement cancellation. 2017-07-04 14:46:03 -07:00
Andres Freund e190cdf77e Fix some trailing whitespace. 2017-07-04 12:38:52 -07:00
Marco Slot 1ed7976cb9 Change implementation of shard_name UDF to get schema-qualified shard name 2017-07-04 10:49:40 +03:00
Onder Kalaci dc9b63504e Add some utility functions for partitioned tables
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`
2017-06-28 09:39:55 +03:00
Andres Freund 3ab288bf66 Remove version check from pg_regress_multi.pl
The check is not necessary anymore after f59cf2b818.
2017-06-26 18:07:43 -07:00
Andres Freund 80483bcab2 Remove 9.5 references from comments in schedule files.
Replace with version-less reference, no point in repeating this for
every release.
2017-06-26 18:04:32 -07:00
Andres Freund 1a728f747b Remove 9.5 regression test output files. 2017-06-26 12:17:46 -07:00
Jason Petersen 05aef7ce29 Support PostgreSQL 10 (#1379)
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.
2017-06-26 02:35:46 -06:00
Andres Freund 2e7e40dc66 Add some tests checking that maintenance daemon gets started.
The 2nd database one is a bit slow, but also shows something
important, so we might want to keep it?
2017-06-23 11:53:39 -07:00
Andres Freund 0df00a0955 Force cache invalidation machinery to be initialized earlier.
Previously it was not guaranteed that invalidations were registered
after creating the extension, only if the extension was used
afterwards.
2017-06-23 11:20:10 -07:00
Marco Slot d4295587aa Fix spuriously failing regression test 2017-06-23 10:06:15 +02:00
Marco Slot 5f84d8e0c4 Add weird column name to create_distributed_table test 2017-06-22 16:27:39 +02:00
Marco Slot 9d14e70716 Clarify error message when copying NULL value into table 2017-06-22 15:48:24 +02:00
Marco Slot f1c6c966f0 Execute INSERT..SELECT via coordinator if it cannot be pushed down
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.
2017-06-22 15:46:30 +02:00
Marco Slot 7675d21151 Simplify router planner call path 2017-06-22 15:45:57 +02:00
Jason Petersen ffaae84fa5 Don't call PostProcessUtility for local commands
It is intended only to aid in processing of distributed DDL commands,
but as written could execute during local CREATE INDEX CONCURRENTLY
commands.
2017-06-19 15:56:03 -06:00
Marco Slot a6eb469ff5 Add support for unlogged distributed tables 2017-06-14 13:50:00 +02:00
velioglu 57bb512069 Use placement connection to drop shards instead of node connection 2017-06-14 14:14:59 +03:00
Marco Slot 7396cbe9e2 Allow COPY after a multi-shard command
This change removes the XactModificationLevel check at the start of COPY
that was made redundant by consistently using GetPlacementConnection.
2017-06-09 13:54:58 +02:00
Jason Petersen 5353705dc3 Add ORDER clause to subquery test missing it 2017-06-08 18:30:14 -06:00
Jason Petersen d8083e5cb5 Remove tracked files from gitignore
Causes very hard-to-debug test failures.
2017-06-08 17:39:31 -06:00
jmunsch 2192638000 Clarify error message for local and distributed query plans. 2017-06-01 11:52:49 -07:00
Onder Kalaci c6629fd4e8 Improve subquery pushdown regression tests
- Use native postgres function for composite key btree functions
  - Move explain tests to multi_explain.sql (get rid of .out _0.out files)
  - Get rid of input/output files for multi_subquery.sql by moving table creations
  - Update some comments
2017-05-30 14:05:15 +03:00
Burak Yucesoy 4c04d3beb4 Add tests for version check 2017-05-24 17:39:25 +03:00
Önder Kalacı 9fbdbd183e Merge branch 'master' into better_comment_for_tests 2017-05-22 10:58:21 +03:00
Onder Kalaci 4a1730d85d Add comment to the regression test file to prevent any misunderstandings about
the usage of enable_router_execution GUC variable.
2017-05-22 10:39:32 +03:00
Burak Yucesoy 2448950665 Add tests for version checks 2017-05-22 09:53:29 +03:00
Jason Petersen 618102cda5 Bump extension and configure PACKAGE versions
Actually getting this done before the next dev cycle begins.
2017-05-17 15:25:30 -06:00
Jason Petersen 1b60dd71d9 Limit sequence SELECT to last_value
Unbounded column output differs by version.
2017-05-16 11:05:34 -06:00
Jason Petersen 8fe806db58 Suppress hash index warning
Irrelevant to the test.
2017-05-16 11:05:34 -06:00
Jason Petersen e3edf83b7c Change version-sensitive tests to handle '10'
Previously assumed period in version; this makes tests future-proof.
2017-05-16 11:05:34 -06:00
Jason Petersen 53e54c66fa Remove ALTER SEQUENCE from parallel groups
Removing these has no side effect, and in the (current) PostgreSQL 10,
an ERROR is printed during concurrent sequence modification.
2017-05-16 11:05:34 -06:00
Jason Petersen 8b0a4d8315 Add unambiguous ORDER BY clauses to many tests
Queries which do not specify an order may arbitrarily change output
across PostgreSQL versions.
2017-05-16 11:05:34 -06:00
Jason Petersen 5855e8f3e5 Update header comments to match new test names
Just keeping these in sync with the actual file name.
2017-05-16 11:05:33 -06:00
Jason Petersen c51c17327d Rename very long test files
In addition to not actually providing much information, these names can
cause problems in PostgreSQL 10.
2017-05-16 11:05:33 -06:00
Burak Yucesoy 25d2cac8f6 Add tests for non-default schema owner 2017-05-15 16:49:37 +03:00
Önder Kalacı b419013226 Add 9.5 output file for isolation test (#1413)
With commit we add one additional regression test output file which
has some output syntax differences with its 9.6 equivalence.
2017-05-15 15:27:37 +03:00
Jason Petersen b6740e75f1 Mark test failing in 9.5 as 'ignore'
This test was added this morning, but is failing in 9.5.
2017-05-12 15:00:42 -06:00
Burak Yucesoy 7e54ba5199 Travis merge jobs use custom-compiled PostgreSQL
With this commit, we start to use custom compiled PostgreSQL builds in
Travis for merge commits. This allows us to run isolation tests and
PostgreSQL's own regression tests along with our regression tests in
Travis.

Since manually compiling PostgreSQL takes more time and we also add new
tests, we only enable running these tests on merge commits.
2017-05-12 15:00:42 -06:00