Commit Graph

630 Commits (1d52af2492ac63795444e738729694148b6f192e)

Author SHA1 Message Date
Jason Petersen 1d52af2492
Bump static assert
No changes needed; won't have to check again until 10.1, or whatever
that version ends up being called.
2017-06-09 16:03:14 -06:00
Jason Petersen d5e636b84d
Preserve behavior of self dependency recording
recordDependencyOnSingleRelExpr now accepts a "ignore_self" flag to
disable recording self-dependencies. Passing "false" preserves existing
behavior.
2017-06-09 16:03:14 -06:00
Jason Petersen 6a4cd9965c
Handle pg_analyze_and_rewrite signature change
Now requires a RawStmt rather than any old Node. Methods to parse DDL
into a list of Nodes now return a list of RawStmts; the old Nodes we
expect are available as one of their fields. ParseTreeRawStmt is used
in PostgreSQL 10 to obtain the RawStmt itself; the behavior of the old
ParseTreeNode is preserved and it always returns a simple Node.
2017-06-09 16:03:14 -06:00
Jason Petersen b2319011fe
Specify column in owned sequence call
getOwnedSequences can now filter owned sequences by a specified column.
Passing InvalidAttrNumber preserves the original behavior of returning
all sequences owned by a specified relation.
2017-06-09 16:03:13 -06:00
Jason Petersen b1cf59e32a
Specify dependency type in seq. ownership check
sequenceIsOwned now accepts a dependency type, but simply passing
DEPENDENCY_AUTO preserves existing behavior.
2017-06-09 16:03:13 -06:00
Jason Petersen fdfcbaeb2a
Use new catalog modification wrappers
PostgreSQL 10 removes the ability to directly call CatalogUpdateIndexes
in favor of new CatalogTupleUpdate and CatalogTupleInsert calls, which
do this for us.
2017-06-09 16:03:13 -06:00
Jason Petersen cf7bfdb22b
Address various header changes
Certain PostgreSQL 10 changes require modifications to our includes:

  * pg_sequence's interace has been refactored into its own file
  * textToQualifiedNameList is now in utils/varlena.h
  * pg_getnameinfo_all is now in common/ip.h
  * stringToQualifiedNameList is now in utils/regproc.h
2017-06-09 16:03:13 -06:00
Jason Petersen 300349e646
Handle BeginCopyFrom changes
BeginCopyFrom now accepts a ParseState and callback argument, but it's
again fine to just NULL out both arguments.
2017-06-09 16:03:13 -06:00
Jason Petersen caaaa2c9f7
Handle makeDefElem changes
makeDefElem now requires the token location, but simply passing -1 to
signify "unknown" is sufficient.
2017-06-09 16:03:13 -06:00
Jason Petersen 3c507e7399
Handle LWLockRegisterTranche changes
The initialization of a custom lock tranche is somewhat simplified in
PostgreSQL 10: now a name and identifier are sufficient.
2017-06-09 16:03:13 -06:00
Jason Petersen 0b4b9aa5a9
Add PG_WAIT_EXTENSION to Read/WriteFile calls
Read/WriteFile adds the same "wait_event_info" argument, so I've added
a PG_WAIT_EXTENSION to all these calls as well.
2017-06-09 16:03:13 -06:00
Jason Petersen 4610978c10
Add PG_WAIT_EXTENSION to WaitLatchOrSocket calls
WaitLatchOrSocket now accepts a "wait_event_info" argument for use by
pg_stat. Extensions appear to mostly just pass "PG_WAIT_EXTENSION", so
that's what I've done.
2017-06-09 16:03:13 -06:00
Jason Petersen 603b9cf3c4
Handle ProcessUtility changes
PostgreSQL 10's ProcessUtility now requires a PlannedStmt with its
utilityStmt field set to what we used to pass directly.

In addition, it receives a QueryEnvironment reference, altogether new
but apparently OK to NULL out for now.

This adds a wrapper to adapt to the new style and fixes all callers.
2017-06-09 16:03:13 -06:00
Jason Petersen a34e9e30d7
Rename PartitionKey to DistPartitionKey
PostgreSQL 10 adds a PartitionKey symbol which conflicts with ours.
2017-06-09 16:03:13 -06:00
Jason Petersen 0d873b0758
Add pg_regress_multi support for PostgreSQL 10
We'll need to be able to run tests against PostgreSQL 10.
2017-06-09 16:03:13 -06:00
Marco Slot 70abfd29d2 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 50501227e9
Add ORDER clause to subquery test missing it 2017-06-08 18:30:14 -06:00
Jason Petersen cc190a4af9
Remove tracked files from gitignore
Causes very hard-to-debug test failures.
2017-06-08 17:39:31 -06:00
jmunsch 1647d17a14 Clarify error message for local and distributed query plans. 2017-06-01 11:52:49 -07:00
Marco Slot f1d804180b Don't take a table lock in ForeignConstraintGetReferencedTableId 2017-05-31 11:15:21 +02:00
Onder Kalaci df494c0403 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 aff6a3dcc4 Add tests for version check 2017-05-24 17:39:25 +03:00
Burak Yucesoy 8c1bbf1417 Register cache invalidation callback before version checks
With this commit we start to register InvalidateDistRelationCacheCallback
function as cache invalidation callback function before version checks
because during version checks we use cache to look up relation ids of some
relations like pg_dist_relation or pg_dist_partition_logical_relid_index
and we want to know about cache invalidation before accessing them.
2017-05-24 17:39:25 +03:00
Burak Yucesoy c7bfa06cb9 Fix incorrect call to CheckInstalledVersion
During version update, we indirectly calld CheckInstalledVersion via
ChackCitusVersions. This obviously fails because during version update it is
expected to have version mismatch between installed version and binary version.
Thus, we remove that ChackCitusVersions. We now only call ChackAvailableVersion.
2017-05-24 17:39:25 +03:00
Önder Kalacı 757f5be858 Merge branch 'master' into better_comment_for_tests 2017-05-22 10:58:21 +03:00
Onder Kalaci a5c12b968b 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 7a7c74cc87 Add tests for version checks 2017-05-22 09:53:29 +03:00
Burak Yucesoy 9fb15c439c Add version checks to necessary UDFs 2017-05-22 09:53:29 +03:00
Burak Yucesoy eea8c51e1f Only error out on distributed queries when there is version mismatch
Before this commit, we were erroring out at almost all queries if there is a
version mismatch. With this commit, we started to error out only requested
operation touches distributed tables.

Normally we would need to use distributed cache to understand whether a table
is distributed or not. However, it is not safe to read our metadata tables when
there is a version mismatch, thus it is not safe to create distributed cache.
Therefore for this specific occasion, we directly read from pg_dist_partition
table. However; reading from catalog is costly and we should not use this
method in other places as much as possible.
2017-05-22 09:53:29 +03:00
Burak Yucesoy acb0d23717 Fix crash during upgrade from 5.2 to 6.2
This commit fixes the problem where we incorrectly try to reach distributed table
cache when the extension is not loaded completely. We tried to reach the cache
because we wanted to get reference table information to activate the node. However
it is actually not necessary to explicitly activate the nodes which come from
master_initialize_node_metadata. Because it only runs during extension creation and
at that time there are no reference tables and all nodes are considered as active.
2017-05-19 00:01:36 +03:00
Jason Petersen cc45712144 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 791cdd7648
Limit sequence SELECT to last_value
Unbounded column output differs by version.
2017-05-16 11:05:34 -06:00
Jason Petersen 51137184d9
Suppress hash index warning
Irrelevant to the test.
2017-05-16 11:05:34 -06:00
Jason Petersen 489aa73257
Add missing CCI call in metadata seq sync
Be explicit about the fact that we've made a modification: we need
subsequent commands to see this sequence.
2017-05-16 11:05:34 -06:00
Jason Petersen 97f8302c9c
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 d6cccee5bc
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 db11324ac7
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 b9bc3fdada
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 9f4a33eee1
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
Jason Petersen c9fa11b445
Use library and symbol name for bgw entry
PostgreSQL 10 takes away the ability to directly assign a function
pointer; the other approach (library and symbol name) is supported by
all versions.
2017-05-16 11:05:33 -06:00
Jason Petersen f86920f9d6
Add includes for missing standard headers
We use symbols from each of these and were relying on them being
included by other headers.
2017-05-16 11:05:33 -06:00
Jason Petersen 82b03d5cb6
Add explicit cast for argument to copyObject
PostgreSQL 10 adds a call to typeof, if supported.
2017-05-16 11:05:33 -06:00
Burak Yucesoy 577ffb2bf2 Add tests for non-default schema owner 2017-05-15 16:49:37 +03:00
Burak Yucesoy 5a3a32d6df Quote schema's owner name
When we propogate the schema creation command to data nodes we add schema's
owner name too. Before this patch, we did not quote the owner's name which
causes problems with the names containing characters like '-'.
2017-05-15 16:26:32 +03:00
Burak Yucesoy 1b5560b2f7 Fix OwnerName function to work with schemas
We incorrectly try to use relation cache to find particular schema's owner and
when we cannot find the schema in the relation cache(i.e always), we automatically
used current user as the schema's owner. This means we always created schemas in
the data nodes with current user. With this patch we started to use namespace
cache to find schemas.
2017-05-15 16:26:32 +03:00
Önder Kalacı a7c65a3ed8 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 05d42b01d3
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 75d58cbf94
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
Önder Kalacı 3adbbdcdcb Fix typo in the regression test (#1410) 2017-05-12 15:46:38 +03:00
Önder Kalacı e0257aecd9 Accept invalidation messages before accessing the metadata cache (#1406)
* Accept invalidation messages before accessing the metadata cache

This commit is crucial to prevent stale metadata reads from the
cache. Without this commit, some of the operations may use stale
metadata which could end up with various bugs such as crashes,
inconsistent/lost data etc.

As an example, consider that a COPY operation is blocked on shard
metadata lock. Another concurrent session updates the metadata and
invalidates the cache. However, since Citus doesn't accept invalidations,
COPY continues with the stale metadata once it acquires the lock.

With this commit, we make sure that invalidation messages are accepted
just before accessing the metadata cache and preventing any operation to
use stale metadata.

* Add isolation tests for placement changes and conccurrent operations

   - add node with reference table vs COPY/insert/update/DDL
   - repair shard vs COPY/insert/update/DDL
   - repair shard vs repair shard
2017-05-12 12:32:35 +03:00