Commit Graph

949 Commits (a26edd2249c4326747667d17dd13948f1fa13527)

Author SHA1 Message Date
velioglu a26edd2249 Implement ALTER TABLE ADD CONSTRAINT command 2017-04-20 15:02:33 +03:00
Burak Velioglu 5170731848 Merge pull request #1316 from citusdata/add_guc_for_cross_shard
Log cross-shard queries
2017-04-20 14:08:21 +03:00
velioglu 5b3e47de7a Log message of across shard queries according to the log level 2017-04-20 12:24:46 +03:00
Burak Velioglu 1e6e5fd512 Merge pull request #1324 from citusdata/insert_into_select_wo_native
Replace native hash function with worker_hash
2017-04-19 22:30:52 +03:00
velioglu be3cdb14ea Change native hash function with worker_hash 2017-04-19 22:16:55 +03:00
Jason Petersen e619e50590 Merge pull request #1312 from citusdata/rename_support
Enable distributed ALTER TABLE ... RENAME COLUMN

cr: @byucesoy
2017-04-18 22:57:12 -06:00
Jason Petersen f999bcd7ca Enable distributed ALTER TABLE ... RENAME COLUMN
Pretty straightforward. Had some concerns about locking, but due to the
fact that all distributed operations use either some level of deparsing
or need to enumerate column names, they all block during any concurrent
column renames (due to the AccessExclusive lock).

In addition, I had some misgivings about permitting renames of the dis-
tribution column, but nothing bad comes from just allowing them.

Finally, I tried to trigger any sort of error using prepared statements
and could not trigger any errors not also exhibited by plain PostgreSQL
tables.
2017-04-18 22:47:48 -06:00
Marco Slot 065d167d2e Merge pull request #1208 from citusdata/remove_job_id_seq
Stop using a sequence to generate job IDs
2017-04-18 12:02:07 +02:00
Marco Slot 0f63edc5b4 Add basic read-only transaction tests 2017-04-18 11:42:33 +02:00
Marco Slot 53899946e7 Remove redundant pg_dist_jobid_seq restarts in tests 2017-04-18 11:42:32 +02:00
Marco Slot d7a5f6997c Set citus.enable_unique_job_ids in tests with job ID in output 2017-04-18 11:42:32 +02:00
Marco Slot c7603215dd Stop using a sequence to generate unique job IDs 2017-04-18 11:31:51 +02:00
Burak Yücesoy f035885269 Merge pull request #1332 from citusdata/set_isactive_to_true
Set default value of isactive to true
2017-04-17 23:38:45 -08:00
Burak Yucesoy 58a809b0e8 Set default value of isactive to true
With this change, we set to default value of isactive column to true so that
upgrading users all nodes will be marked as active to not break their environment.
2017-04-18 09:40:44 +03:00
Burak Yücesoy 3a8bfa3c41 Merge pull request #1326 from citusdata/fix_node_copy_error
Fix node copy error
2017-04-17 09:19:55 -08:00
Burak Yucesoy 5aefe20725 Fix node copy error
Instead of directly returning heap tuple obtained from heap scan
we return copied version of it.
2017-04-17 19:38:18 +03:00
Marco Slot 24eecde0cc Merge pull request #1320 from citusdata/prepared_update_delete
Support UPDATE/DELETE with parameterised partition column qual
2017-04-17 16:32:37 +02:00
Metin Doslu f45c2c43b5 Fix table in name in prepared statement regression tests 2017-04-17 16:17:30 +02:00
Marco Slot a4c98727be Support UPDATE/DELETE with parameterised partition column qual 2017-04-17 16:17:30 +02:00
Marco Slot 6a50fba3c9 Merge pull request #1321 from citusdata/prepared_function_evaluation
Support query parameters in combination with function evaluation
2017-04-17 16:16:27 +02:00
Marco Slot 2fbe546ddd Support query parameters in combination with function evaluation 2017-04-17 15:40:55 +02:00
Marco Slot c350d428ae Merge pull request #1232 from citusdata/fetch_faster
Create indexes after worker_append_table_to_shard when copying a shard
2017-04-17 15:30:44 +02:00
Marco Slot ccc796cf66 Create indexes after worker_append_table_to_shard during shard repair 2017-04-17 15:17:21 +02:00
Burak Yücesoy fd5ada0ab6 Merge pull request #1283 from citusdata/decouple_activate
Decouple reference table replication
2017-04-17 02:48:15 -08:00
Burak Yucesoy d58cb416a4 Decouple reference table replication
With this change we add an option to add a node without replicating all reference
tables to that node. If a node is added with this option, we mark the node as
inactive and no queries will sent to that node.

We also added two new UDFs;
 - master_activate_node(host, port):
    - marks node as active and replicates all reference tables to that node
 - master_add_inactive_node(host, port):
    - only adds node to pg_dist_node
2017-04-17 13:33:31 +03:00
Burak Yücesoy 8e0795ccb5 Merge pull request #1309 from citusdata/fix_sql_function_returns_wrong_result
Error out on parameterized SQL functions
2017-04-13 06:01:51 -08:00
Burak Yucesoy cd5dc2693d Error out on parameterized SQL functions
Before this commit, we were erroring out for queries containing parameterized SQL functions
like 'SELECT parameterized_sql_query(value)' as we should, however we were returning wrong
results for queries like 'SELECT * FROM parameterized_sql_query(value)'. With this commit
we started to error out on such queries too.
2017-04-13 16:36:24 +03:00
Önder Kalacı 6907c56bd2 Merge pull request #1268 from citusdata/remove_adding_qual_prototype
Replace adding the qual logic with attribute equivalence for INSERT ... SELECT
2017-04-13 13:48:14 +03:00
Onder Kalaci 6c9296aca0 Remove uninstantiated qual logic, use attribute equivalences
In this PR, we aim to deduce whether each of the RTE_RELATION
is joined with at least on another RTE_RELATION on their partition keys. If each
RTE_RELATION follows the above rule, we can conclude that all RTE_RELATIONs are
joined on their partition keys.

In order to do that, we invented a new equivalence class namely:
AttributeEquivalenceClass. In very simple words, a AttributeEquivalenceClass is
identified by an unique id and consists of a list of AttributeEquivalenceMembers.

Each AttributeEquivalenceMember is designed to identify attributes uniquely within the
whole query. The necessity of this arise since varno attributes are defined within
a single level of a query. Instead, here we want to identify each RTE_RELATION uniquely
and try to find equality among each RTE_RELATION's partition key.

Whenever we find an equality clause A = B, where both A and B originates from
relation attributes (i.e., not random expressions), we create an
AttributeEquivalenceClass to record this knowledge. If we later find another
equivalence B = C, we create another AttributeEquivalenceClass. Finally, we can
apply transitity rules and generate a new AttributeEquivalenceClass which includes
A, B and C.

Note that equality among the members are identified by the varattno and rteIdentity.

Each equality among RTE_RELATION is saved using an AttributeEquivalenceClass where
each member attribute is identified by a AttributeEquivalenceMember. In the final
step, we try generate a common attribute equivalence class that holds as much as
AttributeEquivalenceMembers whose attributes are a partition keys.
2017-04-13 11:51:26 +03:00
Burak Velioglu 06b3ada188 Merge pull request #1318 from citusdata/ltree_copy_branch
Change checks with built-in type (omit ltree)
2017-04-11 14:50:19 +03:00
velioglu 584c0c34a3 Change checks with built-in type 2017-04-11 14:41:37 +03:00
Burak Velioglu 91d558deeb Merge pull request #1300 from citusdata/ltree_copy_branch
Change copy format of ltree
2017-04-11 08:41:44 +03:00
velioglu 5ba77d8abb Check binary output function of type. 2017-04-10 16:28:09 +03:00
Jason Petersen 960c897877 Merge pull request #1277 from citusdata/error_out_incomplete_installation
Error out if binary citus version does not match installed extension

cr: @jasonmp85
2017-04-04 16:49:03 -06:00
Jason Petersen fc2c23f15a Use RESET for GUC test, not reconnect
More limited in what it does, better test.
2017-04-04 16:40:17 -06:00
Jason Petersen b0a8d9da34 Add comments, use strncmp, clean up GUC desc.
Good to go!
2017-04-04 16:16:49 -06:00
Jason Petersen 2ce82abb04 Clean up remaining error messages
Added details and hints, based off of similar PostgreSQL scenarios.
2017-04-04 16:11:59 -06:00
Jason Petersen 41612177be Clean up ErrorIfUnstableCreateOrAlterExtensionStmt
Swaps an Assert in for an ereport, and adds details and hints to the
error message to help users with a possibly confusing scenario.
2017-04-04 15:58:57 -06:00
Jason Petersen 0e6e42c59a Refactor utility-skip/extn-check code
This was getting pretty long and complex in the context of the main
utility hook. Moved out the checks for what should skip Citus process-
ing and what should have version checks performed.
2017-04-04 15:07:22 -06:00
Burak Yucesoy 66a801dd4e Add enable_version_checks GUC and address feedback 2017-04-04 19:11:13 +03:00
Jason Petersen 0707f262b6 Self-implemented review feedback
The use of a bare src/ rather than $srcdir caused configure to fail
during VPATH builds. With our additional dependency upon AWK, we need
to call AC_PROG_AWK, otherwise environments may not have $AWK set.
Finally, citus_version.h should be in .gitignore.
2017-04-03 22:55:12 -06:00
Burak Yucesoy 63b232e4ba Error out if binary citus version does not match installed extension
With this change, we start to error out if loaded citus binaries does not match
the available major version or installed citus extension version. In this case
we force user to restart the server or run ALTER EXTENSION depending on the
situation
2017-04-03 17:36:13 -06:00
Jason Petersen ae575463dd Merge pull request #1287 from citusdata/support_concurrently
Support (CREATE|DROP) INDEX CONCURRENTLY

cr: @metdos
2017-04-03 12:06:11 -06:00
Jason Petersen 963090fe05 Address review feedback
Should just about do it.
2017-04-03 11:44:57 -06:00
Jason Petersen afe6908e26 Improve CONCURRENTLY-related error messages
Thought this looked slightly nicer than the default behavior.

Changed preventTransaction to concurrent to be clearer that this code
path presently affects CONCURRENTLY code only.
2017-04-03 11:19:15 -06:00
Jason Petersen ddc8d7111b Update documentation
Ensure all functions have comments, etc.
2017-04-03 11:19:15 -06:00
Jason Petersen d128ad723a Address MX CONCURRENTLY problems
Adds a non-transactional multi-command method to propagate DDLs to all
MX/metadata-synced nodes.
2017-04-03 11:19:15 -06:00
Jason Petersen afa9bd4840 Add code to set index validity on failure
Coordinator code marks index as invalid as a base, set it as valid in a
transactional layer atop that base, then proceeds with worker commands.
If a worker command has problems, the rollback results in an index with
isvalid = false. If everything succeeds, the user sees a valid index.
2017-04-03 11:19:15 -06:00
Jason Petersen 236c6900ff Remove CONCURRENTLY checks, fix tests
Still pending failure testing, which broke with my recent changes.
2017-04-03 11:19:15 -06:00
Jason Petersen c7f31ee90a Change DropStmt to generate worker DDL on master
Because we can't execute DROP INDEX CONCURRENTLY during transactions,
worker_apply_shard_ddl_command is insufficient.
2017-04-03 11:19:15 -06:00