Commit Graph

1217 Commits (3a0571e69b74f225e36a0b3e40834b577ce3886d)

Author SHA1 Message Date
Marco Slot ea1fd9dd67 Merge pull request #1487 from citusdata/prepared_implicit_casts
Evaluate implicit casts in prepared statements
2017-07-06 21:49:03 +02:00
Marco Slot 31debc96e3 Handle implicit casts in prepared INSERTs 2017-07-06 16:17:35 +02:00
Andres Freund 74a6bac8cc Merge pull request #1473 from citusdata/fix/cancellation
Fix issues around statement cancellation and connection closure.
2017-07-04 14:58:23 -07:00
Andres Freund d76b093185 Add tests for statement cancellation. 2017-07-04 14:46:03 -07:00
Andres Freund 3461244539 Don't wait for statement completion when aborting coordinated transaction.
Previously we used ForgetResults() in StartRemoteTransactionAbort() -
that's problematic because there might still be an ongoing statement,
and this causes us to wait for its completion.  That e.g. happens when
a statement running on the coordinator is cancelled.
2017-07-04 14:46:03 -07:00
Andres Freund 0d791f6740 Cancel statements when closing connection at transaction end.
That's important because the currently running statement on a worker
might continue to hold locks and consume resources, even after the
connection is closed.  Unfortunately postgres will only notice closed
connections when reading from / writing to the network. That might
only happen much later.
2017-07-04 14:46:03 -07:00
Andres Freund be8677f926 Add NonblockingForgetResults().
This is very similar to ForgetResults() except that no network IO is
performed. Primarily useful in error handling cases.
2017-07-04 14:46:03 -07:00
Andres Freund 24153fae5d Add ShutdownConnection() which cancels statement before closing connection.
That's primarily useful in error cases, where we want to make sure
locks etc held by commands running on workers are released promptly.
2017-07-04 14:46:03 -07:00
Andres Freund 75a7ddea0d Always use connections in non-blocking mode.
Now that there's no blocking libpq callers left, default to using
non-blocking mode in connection_management.c.  This has two
advantages:
1) Blockiness doesn't have to frequently be reset, simplifying code
2) Prevents accidental use of blocking libpq functions, since they'll
   frequently return 'need IO'
2017-07-04 14:46:03 -07:00
Andres Freund 90a2d13a64 Move multi_copy.c to interrupt aware libpq wrappers. 2017-07-04 14:46:03 -07:00
Andres Freund 21c25abbb1 Move multi_client_executor to interrupt aware libpq wrappers. 2017-07-04 12:38:52 -07:00
Andres Freund ddb0651967 Move citus tools to interrupt aware libpq wrappers. 2017-07-04 12:38:52 -07:00
Andres Freund c674bc8640 Add interrupt aware PQputCopy{End,Data} wrappers. 2017-07-04 12:38:52 -07:00
Andres Freund b7f9679ccc Move interrupt handling code from GetRemoteCommandResult to FinishConnectionIO.
Nearby commits will add additional interrupt handling functions, this
way we don't have to duplicate the code.
2017-07-04 12:38:52 -07:00
Andres Freund ec0ed677e3 Fix copy & pasto in WARNING message. 2017-07-04 12:38:52 -07:00
Andres Freund 3dedeadb5e Fix memory leak in RemoteFinalizedShardPlacementList(). 2017-07-04 12:38:52 -07:00
Andres Freund c161c2fbe3 Fix some trailing whitespace. 2017-07-04 12:38:52 -07:00
Burak Velioglu cd8c547165 Merge pull request #1266 from citusdata/fix_shard_name
Change shard_name UDF to include schema
2017-07-04 11:01:52 +03:00
Marco Slot 04fe3f03f6 Change implementation of shard_name UDF to get schema-qualified shard name 2017-07-04 10:49:40 +03:00
Marco Slot 58947e0dcf Merge pull request #1469 from citusdata/move_insert_select
Move INSERT ... SELECT planning logic into one place
2017-06-29 16:50:01 +02:00
Marco Slot da47a03b18 Move INSERT ... SELECT planning logic into one place 2017-06-29 15:03:14 +02:00
Önder Kalacı 907274a58a Merge pull request #1463 from citusdata/partition_distributed_table_utils
Add some utility functions for partitioned tables
2017-06-28 09:50:30 +03:00
Onder Kalaci 5f3f1d75a3 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 0dfc8e6693 Merge pull request #1470 from citusdata/remove_95
Remove 9.5 support.
2017-06-27 14:00:29 -07:00
Andres Freund d25ccf9e00 Update CONTRIBUTING.md to default to 9.6.
9.5 was not supported anymore, and 10 is not released yet. So 9.6
seems appropriate for now.
2017-06-26 18:09:23 -07:00
Andres Freund 535416384c 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 9d7f33be2a 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 bbef9f8650 fixup! Remove 9.5 specific C files. 2017-06-26 17:36:58 -07:00
Andres Freund 2dfd55070c Remove 9.5 regression test output files. 2017-06-26 12:17:46 -07:00
Andres Freund dc3997c3b8 Remove 9.5 related node wrappers.
Now that all branches support the extensible node infrastructure, we
don't need our wrappers anymore.
2017-06-26 08:46:32 -07:00
Andres Freund b96ba9b490 Fix code only enabled for 9.5.
There's still supporting wrappers used, a subsequent commit will
remove those.

This also removes the already unused tuplecount_t define.
2017-06-26 08:46:32 -07:00
Andres Freund 60c28ce7a6 Remove 9.5 specific C files. 2017-06-26 08:46:32 -07:00
Andres Freund 0ebdd26b58 Remove 9.5 support from configure and travis.
This effectively disables 9.5 support, but all the supporting code is
still there.  Subsequent commits will remove that.
2017-06-26 08:46:32 -07:00
Jason Petersen 2204da19f0 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 71a4e90e82 Merge pull request #1461 from citusdata/feature/maintenanced
Add automatically started per-database Maintenance Worker
2017-06-23 12:12:31 -07:00
Andres Freund 4a3b2de4c5 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 c3b7c5dc33 Introduce per-database maintenance process.
This will be used for deadlock detection, prepared transaction
recovery amongst others, but currently is just idling around.
2017-06-23 11:53:39 -07:00
Andres Freund 3483bb99eb Minimal infrastructure for per-backend citus initialization. 2017-06-23 11:20:10 -07:00
Andres Freund 1691f780fd 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
Andres Freund f645dca593 Centralized metadata_cache cache variables into one struct, to avoid missing resets.
E.g. extensionOwner was already missed.
2017-06-23 11:20:10 -07:00
Marco Slot 04e4b7d82a Fix spuriously failing regression test 2017-06-23 10:06:15 +02:00
Marco Slot dc799c6e5e Merge pull request #1468 from citusdata/test_column_name
Add weird column name test for create_distributed_table
2017-06-22 17:14:17 +02:00
Marco Slot 6cafbf9b66 Add weird column name to create_distributed_table test 2017-06-22 16:27:39 +02:00
Marco Slot ce28b6af0d Merge pull request #1402 from citusdata/local_insert_select
Perform INSERT..SELECT via coordinator if it cannot be pushed down
2017-06-22 16:23:34 +02:00
Marco Slot a6f42e4948 Clarify error message when copying NULL value into table 2017-06-22 15:48:24 +02:00
Marco Slot 2f8ac82660 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 2cd358ad1a Support quoted column-names in COPY logic 2017-06-22 15:45:57 +02:00
Marco Slot 155db4d913 Simplify router planner call path 2017-06-22 15:45:57 +02:00
Murat Tuncer 0c4bf2d943 Remove fall back to select if poll is not available (#1466)
poll is supported on all relevant systems, there is no
need to have a fall back mechanism to use select()
2017-06-22 12:11:18 +03:00
Jason Petersen 294aeff2ed
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