Commit Graph

469 Commits (6cb3ae93ba603d95a0189e45209b3de58fb2d250)

Author SHA1 Message Date
Eren Basak 6cb3ae93ba Add Metadata Snapshot Infrastructure
This change adds the required infrastructure about metadata snapshot from MX
codebase into Citus, mainly metadata_sync.c file and master_metadata_snapshot UDF.
2016-10-13 10:40:14 +03:00
Jason Petersen 5d05a3a97e Merge pull request #862 from citusdata/vars_for_job_and_task_ids
Use single-quote interpolation in partition test

cr: @marcocitus
2016-10-10 13:16:37 -06:00
Jason Petersen 9330719b89 Use single-quote interpolation in partition test
Noticed an old issue and this outdated comment. Figured I'd fix it.
2016-10-10 13:03:43 -06:00
Jason Petersen 24afe948b1 Merge pull request #860 from citusdata/fix_and_run_all_tests
Fix tests and tell Travis to run them all

cr: @marcocitus
2016-10-07 17:38:19 -06:00
Jason Petersen 60ec3345a7 Fix tests and tell Travis to run them all
Two sets of tests are fixed by this change:
  * multi_agg_approximate_distinct
  * those in multi_task_tracker_extra_schedule

The first broke when we renamed stage to load in many files and was
never being run because the HyperLogLog extension wasn't easily
available in Debian. Now it's in our repo, so we install it and run
the test. I removed the distinct HLL target in favor of just always
running it and providing an output variant to handle when the extension
is absent. Basically, if PostgreSQL thinks HLL is available, the test
installs it and runs normally, otherwise the absent variant is used.

The second broke when I removed a test variant, erroneously believing
it to be related to an older Citus version. I've added a line in that
test to clarify why the variant is necessary (a practice we should
widely adopt).
2016-10-07 17:32:54 -06:00
Andres Freund b3d1051f50 Merge pull request #857 from citusdata/feature/placementid
Introduce placement IDs.
2016-10-07 12:54:12 -07:00
Marco Slot cc8a30d033 Use UpdateShardPlacementState where appropriate 2016-10-07 11:59:20 -07:00
Andres Freund 5de52c3b04 Introduce placement IDs.
So far placements were assigned an Oid, but that was just used to track
insertion order. It also did so incompletely, as it was not preserved
across changes of the shard state. The behaviour around oid wraparound
was also not entirely as intended.

The newly introduced, explicitly assigned, IDs are preserved across
shard-state changes.

The prime goal of this change is not to improve ordering of task
assignment policies, but to make it easier to reference shards.  The
newly introduced UpdateShardPlacementState() makes use of that, and so
will the in-progress connection and transaction management changes.
2016-10-07 11:59:20 -07:00
Metin Döşlü 8206cf6145 Merge pull request #841 from citusdata/reduce_min_task_tracker_delay
Reduce minimum value of task_tracker_delay to 1ms
2016-10-07 10:10:59 +03:00
Metin Doslu e202746dea Reduce minimum value of task_tracker_delay to 1ms 2016-10-07 09:55:56 +03:00
Marco Slot 82607ee8dd Merge pull request #854 from citusdata/marcocitus-patch-1
Update docs links to v5.2 docs
2016-10-05 16:40:15 -07:00
Marco Slot 406330136c Update docs links to v5.2 docs 2016-10-06 01:27:30 +02:00
Eren Başak 9fd03fe632 Merge pull request #798 from citusdata/786-add_pg_dist_node
Replace pg_worker_list.conf with a pg_dist_node table
2016-10-05 13:12:01 +03:00
Brian Cloutier 62e7bdbdd6 Switch from pg_worker_list.conf file to pg_dist_node metadata table.
Related to #786

This change adds the `pg_dist_node` table that contains the information
about the workers in the cluster, replacing the previously used
`pg_worker_list.conf` file (or the one specified with `citus.worker_list_file`).

Upon update, `pg_worker_list.conf` file is read and `pg_dist_node` table is
populated with the file's content. After that, `pg_worker_list.conf` file
is renamed to `pg_worker_list.conf.obsolete`

For adding and removing nodes, the change also includes two new UDFs:
`master_add_node` and `master_remove_node`, which require superuser
permissions.

'citus.worker_list_file' guc is kept for update purposes but not used after the
update is finished.
2016-10-05 13:01:35 +03:00
Marco Slot 5f81a84cfe Merge pull request #816 from citusdata/mx/add_partition_column
Add replication model column to pg_dist_partition
2016-10-05 02:38:16 -07:00
Marco Slot 31ab616b31 Add replication model column to pg_dist_partition 2016-10-05 01:14:28 +02:00
Önder Kalacı e678c57648 Merge pull request #838 from citusdata/update_function_name
Update ColocatedShardPlacementList() function name to
2016-10-04 11:31:47 +03:00
Onder Kalaci 06217bade0 Update ColocatedShardPlacementList() function name to
ColocatedShardIntervalList() which was intented.
2016-10-04 09:51:42 +03:00
Marco Slot e1f86bb9ae Merge pull request #837 from citusdata/bugfix/pnstrdup
Avoid use of pnstrdup
2016-10-04 07:09:15 +02:00
Marco Slot b79c8657d6 Avoid use of pnstrdup 2016-10-04 00:31:53 +02:00
Marco Slot 01cec61288 Merge pull request #783 from robin900/new-extend-names
Provides safe, backwards-compatible shard-extended names to any object name
2016-10-03 23:17:44 +02:00
Robin Thomas d23f11490a Provides safe, idempotent shard-extended names to any object name
related to a table that might be distributed, allowing any name
that is within regular PostgreSQL length limits to be extended
with a shard ID for use in shards on workers. Handles multi-byte
character boundaries in identifiers when making prefixes for
shard-extended names. Includes tests.
Uses hash_any from PostgreSQL's access/hashfunc.c.
Removes AppendShardIdToStringInfo() as it's used only once
and arguably is best replaced there with a call to AppendShardIdToName().

Adds UDF shard_name(object_name, shard_id) to expose the shard-extended
name logic to other PL/PGSQL, UDFs and scripts.

Bumps version to 6.0-2 to allow for UDF to be created in migration script.

Fixes citusdata/citus#781 and citusdata/citus#179.
2016-10-03 17:02:34 -04:00
Andres Freund 1c1c502318 Merge pull request #834 from citusdata/valgrind-clean
Fix issues making valgrind fail
2016-10-03 14:01:27 -07:00
Andres Freund 3f8fb191cc Don't create hash-table of zero size in TaskHashCreate().
hash_create(), called by TaskHashCreate(), doesn't work correctly for a
zero sized hash table. This triggers valgrind errors, and could
potentially cause crashes even without valgring.

This currently happens for Jobs with 0 tasks. These probably should be
optimized away before reaching TaskHashCreate(), but that's a bigger
change.
2016-10-03 13:07:43 -07:00
Andres Freund 9ebc46d15c Initialize count_agg_clauses argument to 0.
count_agg_clause *adds* the cost of the aggregates to the state
variable, it doesn't reinitialize it. That is intentional, as it is used
to incrementally add costs in some places.
2016-10-03 13:07:43 -07:00
Andres Freund 6de3a92e79 Lower "waiting for activity on tasks took longer than" log level.
It's perfectly normal to wait longer in several circumstances, and the
output can lead to spurious regression output changes.
2016-10-03 13:07:43 -07:00
Marco Slot bd589b4555 Merge pull request #831 from citusdata/ultimate_citus_improvement
Change logicalrelid type to regclass
2016-10-03 20:34:57 +02:00
Marco Slot 992179c187 Change logicalrelid type in pg_dist_partition and pg_dist_shard to regclass 2016-10-03 20:27:16 +02:00
Marco Slot 5c5f7d4478 Merge pull request #832 from citusdata/bugfix/remove_eventinvoke_trigger
Remove EventInvokeTrigger from regression test output
2016-10-03 20:26:19 +02:00
Marco Slot cf419be848 Remove EventInvokeTrigger from regression test output 2016-10-03 20:21:15 +02:00
Marco Slot 6f51aa6e92 Merge pull request #819 from robin900/handle-repartitions-by-typname
During repartitions use partitionColumnType as ::regtype so that UDTs work
2016-10-03 19:50:45 +02:00
Robin Thomas 1e80d27585 During repartitions, the partitionColumnType argument sent to workers
is now a `::regtype` using the qualified name of the column type,
not the column type OID which may differ between master/worker nodes.
Test coverage of a hash reparitition using a UDT as the join column.

Note that the UDFs `worker_hash_partition_table` and `worker_range_partition_table`
are unchanged, and rightly expect an OID for the column type; but the
planner code building the commands now allows for `::regtype` casting
to do its magic.

Fixes citusdata/citus#111.
2016-10-03 13:41:20 -04:00
Marco Slot a378b9e8a9 Merge pull request #808 from robin900/partial-index-tests
Added test coverage for partial unique indexes, exclusion constraints
2016-10-03 17:32:16 +02:00
Robin Thomas de5242fa41 Added test coverage for partial unique indexes and exclude constraints. 2016-10-03 10:47:30 -04:00
Eren Başak 10b06da429 Merge pull request #825 from citusdata/fix_command_counter_increment_wrong_place
Fix command counter increment bug
2016-10-03 17:16:58 +03:00
Eren Basak d169caf637 Fix command counter increment bug
Fixes citusdata/citus#714

On `InsertShardRow`, we previously called `CommandCounterIncrement()` before
`CitusInvalidateRelcacheByRelid(relationId);`. This might prevent to skip
invalidation of the distributed table in the next access within the same session.
2016-10-03 17:00:27 +03:00
Eren Başak 13dbe1ecb4 Merge pull request #742 from citusdata/feature/task_tracker_folders
Differentiate worker and master job temporary folders - MX Backport
2016-10-03 14:29:54 +03:00
Onder Kalaci 727bed9d69 Differentiate worker and master job temporary folders
This commit enables to create different worker and master temporary folders.
This change is important for citus-mx on task-tracker execution. In simple words,
on citus-mx, the worker could actually be reponsible for the master tasks as well.
Prior to this change, both master and worker logic on task-tracker executor was
accessing and using the same files for different purposes which was dangerous on
certain cases (i.e., when task_tracker_delay is low).
2016-10-03 14:24:08 +03:00
Jason Petersen 28a7d769cb Merge pull request #824 from citusdata/use_lock_tranches
Move task tracker lwlocks into their own tranche

cr: @anarazel
2016-09-30 16:11:11 -06:00
Andres Freund 5c02c7dd49 Move task tracker lwlocks into their own tranche.
RequestAddinLWLocks()/LWLockAssign() are gone in 9.6. Luckily all citus
supported postgres versions support tranches, so use those.
2016-09-30 16:06:49 -06:00
Jason Petersen 5a57d7f568 Merge pull request #823 from citusdata/update_postgresql_files
Update PostgreSQL-sourced files with latest changes

cr: @anarazel
2016-09-30 16:06:28 -06:00
Jason Petersen 2a3d8b2913 Remove references to 9.4
Some still lingered.
2016-09-29 17:35:19 -06:00
Jason Petersen 53cd06d4fc Remove alternate multi_hash test file
This was made irrelevant by Citus v5.1.0.
2016-09-29 16:43:19 -06:00
Jason Petersen f4210e1f0e Remove references to PostgreSQL 9.4 support files
No longer extant.
2016-09-29 15:54:38 -06:00
Jason Petersen 5784240df3 Remove gitattributes for csql files
This was missed before.
2016-09-29 15:54:38 -06:00
Jason Petersen 44a5337abd Remove unused dumputils.h header
Believe this was used by csql, which is now gone.
2016-09-29 15:54:38 -06:00
Jason Petersen 44c7626f0c Update ruleutils_95 with latest PostgreSQL changes
Hand-applied changes from a diff I generated between 9.5.0 and 9.5.4.
2016-09-29 15:54:38 -06:00
Marco Slot 9dcba97998 Merge pull request #815 from citusdata/bugfix/count_null
Make count return 0 if all shards are pruned away
2016-09-29 20:32:46 +02:00
Marco Slot 2dfe17b75e Make count return 0 if all shards are pruned away
Before this change, count on a distributed returned NULL if all shards
were pruned away, because on the master we replace with count(..) call
with a sum(..) call to sum the counts from the shards. However, sum
returns NULL when there are no rows, whereas count is expected to return
0.
2016-09-29 20:27:26 +02:00
Jason Petersen 926ed89e9f Merge pull request #818 from citusdata/fix_xact_callbacks
Directly register transaction callbacks in PG_init

cr: @anarazel
2016-09-29 11:52:03 -06:00