Commit Graph

7043 Commits (main)

Author SHA1 Message Date
Jason Petersen 61b6394e4b
Add gitignore rules for latest install files
Got tired of dirty git tree.
2016-05-10 11:57:11 -06:00
Jason Petersen d76ead817b
Add latest CHANGELOG entries 2016-05-10 11:57:00 -06:00
Önder Kalacı de3bcc4364 Merge pull request #495 from citusdata/fix/494_invalid_distributed_explain_json
Distributed EXPLAIN: Generate valid JSON output
2016-05-06 15:01:49 +03:00
Marco Slot 1b4fbc76e2 Add JSON/XML validation to EXPLAIN regression tests and fix issues 2016-05-06 11:30:07 +02:00
Lukas Fittl 2f694f7af3 Distributed EXPLAIN: Generate valid JSON output.
This modifies the EXPLAIN output functions to actually generate
valid JSON output when (FORMAT JSON) is being used.

Fixes #494.
2016-05-05 12:48:01 +02:00
Önder Kalacı ca909a71fc Merge pull request #498 from citusdata/fix_check_full_failure
Fix check-full failures
2016-05-05 13:43:24 +03:00
Onder Kalaci d7fd56df89 Fix check-full failures
This commit fixes failures happen during check-full. The change does make
clean seperation of executor types in certain places to keep the outputs
stable.
2016-05-05 12:28:22 +03:00
Jason Petersen eab60e20de
Add CHANGELOG entry for 5.0.1 2016-05-04 22:07:43 -06:00
Andres Freund 2eb386dcf7 Merge pull request #493 from citusdata/stamp-5.1
Stamp 5.1

CR: Jason
2016-05-04 18:47:01 -07:00
Andres Freund 5f282dd241 Stamp 5.1 release. 2016-05-04 18:05:41 -07:00
Andres Freund 4d7bcfdd35 Generate extension versions from the previous one. 2016-05-04 18:05:41 -07:00
Önder Kalacı 5604669db5 Merge pull request #487 from citusdata/fix_compile_warning
Fix compile time warning
2016-05-04 09:52:05 +03:00
Onder Kalaci 38da3c826b Fix compile time warning
This change fixes a compile time warning related to definition/declaration order
of the code.
2016-05-04 09:42:10 +03:00
Marco Slot 5f35c48132 Merge pull request #485 from citusdata/fix-explain-cost-output
Remove costs from explain regression tests
2016-05-03 22:23:54 +02:00
Marco Slot 845aebfe19 Remove costs from explain regression tests 2016-05-03 22:11:23 +02:00
Metin Döşlü 2db30af07f Merge pull request #468 from citusdata/feature/worker-copy-for-append-partitioning
Add COPY support on worker nodes for append partitioned relations

CR: @marcocitus
2016-05-03 16:08:27 +03:00
Metin Doslu 866271b765 Add COPY support on worker nodes for append partitioned relations
Now, we can copy to an append-partitioned distributed relation from
any worker node by providing master options such as;

COPY relation_name FROM file_path WITH (delimiter '|', master_host 'localhost', master_port 5432);

where master_port is optional and default is 5432.
2016-05-03 16:00:00 +03:00
Marco Slot ecd5b65897 Merge pull request #478 from citusdata/remove_copy_to_distributed_table
Add deprecation warning to copy_to_distributed_table
2016-05-03 14:16:28 +02:00
Marco Slot 0c140cf333 Add deprecation warning to copy_to_distributed_table 2016-05-03 14:08:42 +02:00
Brian Cloutier 58535eb337 Query Planning Performance Improvments (#474)
- Only look at pruned shards when determining AnchorTable
- Use cached shardIntervalCompareFunction during copartition check
2016-05-03 10:48:46 +03:00
Marco Slot becac83ac9 Merge pull request #481 from citusdata/fix-spurious-test-files
Remove spurious intermediate regression test files
2016-05-02 12:57:02 +02:00
Marco Slot 24a74fb0ae Remove spurious intermediate regression test files 2016-05-02 12:30:15 +02:00
Jason Petersen 599dbb99ae Merge pull request #476 from citusdata/fix_connection_status
Force bad connections in tests by closing sockets

cr: @anarazel
2016-04-29 16:05:14 -07:00
Jason Petersen 510783f84f
Force bad connections in tests by closing sockets
Based on Andres' suggestion, I removed SetConnectionStatus, moving its
functionality directly into set_connection_status_bad, which now simply
shuts down the socket underlying a particular connection.

This keeps the functionality as-is while removing our questionable use
of internal libpq headers.
2016-04-29 15:56:04 -07:00
Marco Slot 1859a285a0 Merge pull request #414 from citusdata/feature/explain
Add EXPLAIN for simple distributed queries
2016-04-30 00:35:47 +02:00
Marco Slot fc4f23065a Add EXPLAIN for simple distributed queries 2016-04-30 00:11:02 +02:00
Ahmet Eren Basak 25382c289b Merge pull request #479 from citusdata/fix_mixed_code_and_declaration_warning
FIX "mixed declarations and code" Warning in multi_physical_planner.c
2016-04-29 13:54:35 +03:00
eren 7e19ebe679 FIX "mixed declarations and code" Warning in multi_physical_planner.c
Fixes #477

This change fixes the compile time warning message in BuildMapMergeJob in
multi_physical_planner.c about mixed declarations and code. Basically, the
problematic declaration is moved up so that no expression is before it.
2016-04-29 11:18:04 +03:00
Brian Cloutier 0036eb3253 Allow references to columns in UPDATE statements (#472)
Allow references to columns in UPDATE statements

Queries like "UPDATE tbl SET column = column + 1" are now allowed, so long as you don't use any IMMUTABLE functions.
2016-04-28 05:45:16 -07:00
Ahmet Eren Basak 66eab4e629 Merge pull request #471 from citusdata/rename_copy_transaction_manager
Rename citus.copy_transaction_manager to citus.multi_shard_commit_protocol
2016-04-28 15:28:20 +03:00
eren ab240a7d4c Rename copy_transaction_manager
This change renames the distributed transaction manager parameter from
citus.copy_transaction_manager to citus.multi_shard_commit_protocol.

Distributed transaction manager has been used only by the COPY on hash
partitioned tables but it can be used by upcoming features so, we needed
to rename so that its name do not contain a reference to COPY.

The change also includes renames like transaction_manager_options to
commit_protocol_options and TRANSACTION_MANAGER_1PC to COMMIT_PROTOCOL_1PC.

With this change, declaration of MultiShardCommitProtocol (was
CopyTransactionManager) is moved from multi_copy.c to multi_transaction.c.
2016-04-28 15:12:50 +03:00
Andres Freund 0ce1e3ddaf Perform permission checks on operations re-implemented by citus.
Currently that's just COPY FROM.  There's other places where we could
check for permissions earlier (to fail less verbosely), but since
there's other pending changes in the whole DDL area, which is affected
by this, I'm just adding a note to those places.
2016-04-27 10:28:36 -07:00
Andres Freund 758a70a8ff Create new shards as owned the distributed table's owner.
That's important because ownership of relations implies special
privileges. Without this change, a distributed table can be accessible
by a table's owner, but a shard created by another user might not.
2016-04-27 10:28:33 -07:00
Andres Freund 3a264db2fe Add ReplicateGrantStmt().
This is the basis for coordinating GRANT/REVOKE across nodes.
2016-04-27 10:28:25 -07:00
Andres Freund 7c281fbe07 Add pg_get_table_grants() function and support extending GRANTs. 2016-04-27 10:28:25 -07:00
Andres Freund eae65404d0 Grant SELECT for pg_catalog.pg_dist* to PUBLIC.
Given pg_class et al. are readable by everyone there's little point in
restricting read only access to citus catalogs.
2016-04-27 10:28:25 -07:00
Andres Freund a5b3dcddb3 Run some commands as superuser to allow normal users to execute queries.
Some small parts of citus currently require superuser privileges; which
is obviously not desirable for production scenarios. Run these small
parts under superuser privileges (we use the extension owner) to avoid
that.

This does not yet coordinate grants between master and workers. Thus it
allows to create shards, load data, and run queries as a non-superuser,
but it is not easily possible to allow differentiated accesses to
several users.
2016-04-27 10:28:22 -07:00
Andres Freund 25615ee9d7 Add CitusExtensionOwner(), to execute some priviledged operations under.
There exist some operations we have to execute with elevated
privileges. The most expedient user for that is the user owning the
citusdb extension.
2016-04-27 10:26:08 -07:00
Andres Freund bf87e08331 Replace direct inserts in csql's \stage by serverside functions.
\stage so far directly inserted into pg_dist_shard and
pg_dist_shard_placement. That makes it hard to do effective permission
checks.  Thus move the inserts into two C functions.

These two new functions aren't the nicest abstraction. But as we are
planning to obsolete \stage, it doesn't seem worthwhile to refactor the
client-side code of \stage to allow the use of
master_create_empty_shard() et al.
2016-04-27 10:23:35 -07:00
Andres Freund 12a246de37 Perform permission checks in functions manipulating distributed tables.
Previously several commands, amongst them commands like
master_create_distributed_table(), were allowed for everyone. That's not
good: Even though citus currently requires superuser permissions, we
shouldn't allow non-superusers to perform actions as sensitive as making
a table distributed.

There's no checks on the worker_* functions, as these usually just punt
the action to underlying postgres functionality, which then perform the
necessary checks.
2016-04-27 10:22:20 -07:00
Andres Freund 25f919576f Add very basic infrastructure for schema upgrade scripts.
Citus' extension version now has a -$schemaversion appendix.  When the
schema is changed, a new schema version has to be added; changes to the
same schema version several commits inside a single pull request are ok.

Schema migration scripts between each schema version have to be
added. To ensure upgrade scripts work correctly a new regression test
ensures that all steps work.

The extension scripts to-be-used for CREATE EXTENSION (i.e. not
extension updates) are generated by concatenating citus.sql and the
relevant migration scripts.
2016-04-27 10:00:08 -07:00
Andres Freund 5ffce3393a Always create database for regression tests with a fixed username.
Otherwise the owner of relations and such will depend on the username of
the user running the regression tests. As "postgres" is the most common
username for that purpose, hardcode that in pg_regress_multi.pl.
2016-04-27 10:00:08 -07:00
Andres Freund 42d232c0e8 Use the current session's username when connecting to worker nodes.
So far we've always used libpq defaults when connecting to workers; bar
special environment variables being set that'll always be the user that
started the server.  That's not desirable because it prevents using
users with fewer privileges.

Thus change the various APIs creating connections to workers to always
use usernames. That means:
1) MultiClientConnect() needs to, optionally, accept a username
2) GetOrEstablishConnection(), including the underlying cache, need to
   use the current user as part of the connection cache key. That way
   connections for separate users are distinct, and we always use one
   with the correct authorization.
3) The task tracker needs to keep track of the username associated with
   a task, so it can use it when establishing connections outside the
   originating session.
2016-04-27 10:00:08 -07:00
Önder Kalacı abb4ec019f Merge pull request #446 from citusdata/fast_shard_pruning
Add fast shard pruning path for INSERTs on hash partitioned tables
2016-04-27 11:33:20 +03:00
Onder Kalaci 108114ab99 Apply final code review feedback
- Fix o(n^2) loop to o(n)
- Collapse two if statements into a single one
- Some coding conventions feedback
2016-04-27 10:36:03 +03:00
Onder Kalaci c4b783b70b Fix Merge Conflict
This commit fixes merge conflicts.
2016-04-26 11:18:47 +03:00
Onder Kalaci 6c7abc2ba5 Add fast shard pruning path for INSERTs on hash partitioned tables
This commit adds a fast shard pruning path for INSERTs on
hash-partitioned tables. The rationale behind this change is
that if there exists a sorted shard interval array, a single
index lookup on the array allows us to find the corresponding
shard interval. As mentioned above, we need a sorted
(wrt shardminvalue) shard interval array. Thus, this commit
updates shardIntervalArray to sortedShardIntervalArray in the
metadata cache. Then uses the low-level API that is defined in
multi_copy to handle the fast shard pruning.

The performance impact of this change is more apparent as more
shards exist for a distributed table. Previous implementation
was relying on linear search through the shard intervals. However,
this commit relies on constant lookup time on shard interval
array. Thus, the shard pruning becomes less dependent on the
shard count.
2016-04-26 11:16:00 +03:00
Joe Nelson 996e56f623 Emphasize our slack room (#464)
* Replace IRC link with Slack signup

Also replace google groups badge with slack badge
2016-04-22 14:54:13 -07:00
Brian Cloutier 1a8939e30d Merge pull request #456 from citusdata/367-drop-extension-messages
DROP EXTENSION without any warnings
2016-04-22 13:39:08 -07:00
Brian Cloutier 7a6d689259 Clear metadata_cache upon DROP EXTENSION
When we notice that pg_dist_partition is being invalidated we assume
that the citus extension is being dropped and drop state such as
extensionLoaded and the cached oids of all the metadata tables.

This frees the user from needing to reconnect after running DROP
EXTENSION, so we also no longer send a warning message.
2016-04-22 07:25:49 -07:00