summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-10-08Accept warnings about inheriting distribution from parentTomas Vondra
Commit e26a0e07d8 started ignoring distributions defined on partitions, but omitted this place in 'rules' when accepting the warnings.
2017-10-08Add explicit VACUUM to stabilize plans in inherit testsTomas Vondra
On stock PostgreSQL, CREATE INDEX also updates statistics in pg_class (relpages and reltuples). But Postgres-XL does not do that, which may result in plan differences when the test relies on this behavior. This is the same issue as in cfb055553687c257dd1d1ed123356c892f48a804, but affecting inherit regression tests. So fix it in the same way, by doing an explicit vacuum on the tables.
2017-10-08Accept plan changes in 'limit' test suiteTomas Vondra
The accepted plan changes seem correct, as the only difference with respect to upstream plans is Limit distribution. The commit diff is a bit more complicated, because the expected plan did not reflect the switch from Result to ProjectSet.
2017-10-08Accept plan change in 'inherit' test suiteTomas Vondra
The plan change is expected, as it simply expands -> Limit to -> Limit -> Remote Subquery Scan -> Limit It wasn't accepted before probably because it was hidden by other failures in the test suite.
2017-10-05Disable FQS for cursors defined with SCROLLTomas Vondra
When checking if a query is eligible for FQS (fast-query shipping), disable the optimization for queries in SCROLL cursors, as FQS does not support backward scans. Discussion: <[email protected]>
2017-09-26Fix minor regression failure in updatable_viewsTomas Vondra
The ATTACH PARTITION command was failing due to mismatching column order. That in turn caused failure in sanity_check, as the table was not dropped when dropping the parent.
2017-09-26Fix expected output in select_view testTomas Vondra
The expected output did not match, likely due to some confusion when merging upstream changes (where the query does not include the ORDER BY clause). The updated output matches exactly to what is produced by upstream after adding the ORDER BY clause.
2017-09-20Improve shared queue synchronization furtherPavan Deolasee
Our efforts to improve shared queue synchronization continues. We now have a per queue producer lwlock that must be held for synchronization between consumers and the producer. Consumers must hold this lock before setting the producer latch to ensure the producer does not miss out any signals and does not go into unnecessary waits. We still can't get rid of all the timeouts, especially we see that sometimes a producer finishes and tries to unbind from the queue, even before a consumer gets chance to connect to the queue. We left the 10s wait to allow consumers to connect. There is still net improvement because when the consumer is not going to connect, it tells the producer and we avoid the 10s timeout, like we used to see earlier.
2017-09-20Enable Hot Standby on the replicasPavan Deolasee
We had an issue with tracking knownXids on the standby and it was overflowing the allocated array in the shared memory. It turned out that the primary reason for this is that the GTM leaves behind a hole in XID allocation when it's restarted. The standby oblivious to this, was complaining about array overflow and thus die. We now fix this by allocating array which can hold CONTROL_INTERVAL worth additional XIDs. This would mostly be a waste because the XIDs are never allocated. But this seems like a quick fix to further test the Hot standby. The good thing is that we might just waste memory, but not have any impact on the performance because of larger array since we only loop for numKnownXids which will be more accurate. With this change, also fix the defaults for datanode and coordinator standbys and make them Hot Standbys. The wal_level is changed too.
2017-09-19Handle Aggref->aggargtypes in out/readfuncs.cTomas Vondra
When communicating with other nodes, we send names of objects instead of OIDs as those are assigned on each node independently. We failed to do this for Aggref->aggargtypes, which worked fine for built-in data types (those have the same OID on all nodes), but resulted in failures for custom data types (like for example FIXEDDECIMAL). ERROR: cache lookup failed for type 16731 This fixes it by implementing READ/WRITE_TYPID_LIST_FIELD, similarly to what we had for RELID. Note: Turns out the WRITE_RELID_LIST_FIELD was broken, but apparently we never call it in XL as it's only used for arbiterIndexes field. So fix that too, in case we enable the feature in the future.
2017-09-18Ensure that we don't read rule definition with portable input onPavan Deolasee
Rules are converted in their string representation and stored in the catalog. While building relation descriptor, this information is read back and converted into a Node representation. Since relation descriptors could be built when we are reading plan information sent by the remote server in a stringified representation, trying to read the rules with portable input on may lead to unpleasant behaviour. So we must first reset portable input and restore it back after reading the rules. The same applies to RLS policies (even though we don't have a test showing the impact, but it looks like a sane thing to fix anyways)
2017-09-17Fix trivial failure in rangefuncs test suiteTomas Vondra
Commit f7d1d581c950191a465b8483173f2ad69ae8fffe converted a couple of sequences to persistent (instead of temporary), but failed to update the expected output.
2017-09-15Fix incorrect planning of grouping setsTomas Vondra
Commit 04f96689945462a4212047f03eb3281fb56bcf2f incorrectly allowed distributed grouping paths for grouping sets, causing failures in 'groupingsets' regression test suite. So fix that by making sure try_distributed_aggregation=false for plans with grouping sets.
2017-09-12Ensure that database objects are created consistently.Pavan Deolasee
We now create views/materialised views on all nodes, unless they are temporary objects in which case they are created only on the local coordinator and the datanodes. Similarly, temporary sequences are created on the local coordinator and the datanodes. This solves many outstanding problems in the regression results where remote nodes used to fail because of non-existent type for a view or similar such issues. A few other test cases now started to work correctly and produce output matching upstream PG. So the expected output for those test cases has been appropriated fixed. Couple of sequences in the rangefuncs test case have been converted into permanent sequences because the subsequent SQL functions refer to them and hence fail if they do not exist on the remote coordinators. The problem with special RULE converting a regular table into a view goes away with the fix since DROP VIEW commands are now propgataed to the datanodes too.
2017-09-11Further refactoring of utility.c codePavan Deolasee
Furthre more simplification and consolidation of the code.
2017-09-08Rearrange switch cases so that they are grouped together when possiblePavan Deolasee
2017-09-08Refactor changes in the utility.cPavan Deolasee
2017-09-07Stamp Postgres-XL 10alpha2Pavan Deolasee
2017-08-30Disable logical decoding as unsupportedTomas Vondra
Commit 665c224a6b2afa disabled CREATE PUBLICATION/SUBSCRIPTION, but it was still possible to create a logical replication slot and call pg_logical_slot_get_changes() on it. That would however crash and burn as ReorderBufferCommit() relies on subtransactions, and BeginInternalSubTransaction() is not expected to fail, leading to segfaults in the PG_CATCH block. Simply disallowing creating logical slots (and whatever else relies on CheckLogicalDecodingRequirements) seems like the best fix.
2017-08-30Accept regression diffs in stats_ext test casePavan Deolasee
The actual result matches with the upstream result. The diffs must have been caused by incorrect merge. So accept those fully.
2017-08-30Fetch the target remote nodes to run CREATE STATISTICS commandPavan Deolasee
Some database objects are created only on a subset of nodes. For example, views are created only on the coordinators. Similarly, temp tables are created on the local coordinator and all datanodes. So we must consult the relation kind before executing the CREATE STATISTICS command on the remote nodes. Otherwise we might try to execute it on a node where the underlying object is missing, resulting in errors. Patch by senhu ([email protected]) which was later reworked by me.
2017-08-29Accept regression diffs in update test casePavan Deolasee
The first diff was in fact a mistake and the actual output matched with the upstream output. It must have been missed during the merge process. The other diff was simply an error because XL doesn't allow updating distribution key column.
2017-08-29Fix plpgsql regression testPavan Deolasee
There were two broad categories of problems. 1. Errors due to lack of savepoint support 2. Errors and side effects due to lack of trigger support. For 1, we reorganised the test case so that they can be run without savepoint. For 2, we mostly accepted the regression changes. Apart from usual errors while creating/dropping triggers, there were differences in query results because of changes to preceding update/insert/delete statements. The behaviour of those statements change because of lack of triggers.
2017-08-29Fix alter_table test casePavan Deolasee
Because of XL's strict requirement on column ordering and positioning, change the test case to avoid DROP COLUMN commands. This kinda makes the test case useless because the sole purpose of the test was to test if things stand up well when there is a mismatch in column numbering. Given the current restriction, there is no other option to make these changes.
2017-08-28Do not add any distribution to a dummy append nodePavan Deolasee
A dummy append node with no subpaths doesn't need any adjustment for distribution. This allows us to actually correct handle UPDATE/DELETE in some cases which were failing earlier.
2017-08-28Much restructing of rowsecurity test casePavan Deolasee
- Some problems related to inherited tables fixed by ensuring column ordering. - ORDER BY clauses added at some other places to ensure consistent row ordering. - Changes related to TABLESAMPLE accepted as XL returns more rows than PG - SAVEPOINTs removed and replaced by transaction blocks as XL does not support subtransaction - NOTICEs are not displayed in XL - Append is pushed down to the remote node now that we impose stricter restrictions on inheritance
2017-08-25Make float8_tbl replicated to stabilize float8 testTomas Vondra
As the table has just a single float8 column, XL automatically picks ROUNDROBIN distribution. Commit 1d14325822 randomized selection of the initial node, which with single-row inserts (used by the float8 tests) effectively means random distribution, while before that all the rows would be routed to the first node. Some of the tests in float8 test suite seem to be sensitive to this, in particular this overflow test: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f ORDER BY f1; ERROR: value out of range: overflow One of the rows (containing 1.2345678901234e-200) triggers an underflow, so when the database hits it first, it will report this error instead: ERROR: value out of range: underflow The probability of hitting this is however fairly low (less than 10%), as the executor has to touch the underflowing value first.
2017-08-25Fix prepared_xacts test casePavan Deolasee
Remove a SAVEPOINT statement, which otherwise fails. Once that is removed, a few other test cases work fine and the associated expected output changes are accepted.
2017-08-25Accept regression diffs in select_implicit test casePavan Deolasee
It was a simple case of change in row ordering because the test case is requesting order by column 'a', but the expected output had order by column 'c'
2017-08-25Accept regression diff in tablesample test casePavan Deolasee
It's just an addition of a Remote Subquery Scan node on top of the regular plan.
2017-08-25Do not try to set invalid value for gucPavan Deolasee
We don't support subtransactions and hence can't handle exception thrown by trying to set invalid value. We'd already removed the exception, but the transaction was being left in an aborted state. So fix this. The test case still fails for some other reason which should be investigated separately.
2017-08-25Accept regression diffs in select_views test casePavan Deolasee
These changes were lost when we removed alternate expected output files for the test case. So these are not new differences and the same ordering is exhibited in XL9.5 as well. NOTICEs are not shown by XL so accept those differences.
2017-08-25Make adjustment to foreign_key test casePavan Deolasee
Accept some diffs which look sane and in-line with the upstream errors. Also comment out a few tests which explictly test subtransactions, something we don't currently support.
2017-08-25Accept errors in hash_index test casePavan Deolasee
We don't support BACKWARD scan of RemoteSubplan and neither support WHERE CURRENT OF. So accept the resulting errors.
2017-08-25Accept errors in tidscan regression testPavan Deolasee
We don't support BACKWARD scan of RemoteSubplan and neither support WHERE CURRENT OF. So accept errors arising out of these limitations. These test case changes are new in XL10 and hence we did not see these failures in the earlier releases of XL.
2017-08-24Make adjustments to combocid test so that it passesPavan Deolasee
SAVEPOINTs were used, which we don't support. So commented those out (along with ROLLBACK calls). That does have an impact on the test case though because at least in one place we were checking if the cmin goes back to 0 after rolling back to a savepoint. But there is not much we can do about that until we add SAVEPOINT support. Other changes include accepting diffs because of ctid changes as rows come from different nodes and hence ctids are duplicated/changed.
2017-08-24Accept regressions diffs in copy2 test casePavan Deolasee
We do not support trigger and hence the regression differences.
2017-08-24Accept regression differences in polymorphism test casePavan Deolasee
As with other test cases, accept the lack of NOTICEs in the test case. This issue needs to be investigated, but surely this is not the only test case that's suffering from this behavioural change. So accept for now and change later once (and when) we fix the NOTICE problem.
2017-08-24Fix identity test casePavan Deolasee
Accept some differences as the identity column is also used distribution column and hence updates are disallowed in XL. So accept those differences (we should later add XL-specific test cases by having identity in non-distribution column). Also add ORDER BY in some select queries to ensure consistent ordering of the result
2017-08-22Accept regression differences in largeobject test casePavan Deolasee
Since large objects are not supported by XL, these were mostly cosmetic differences without any possible bug.
2017-08-22Handle rescan of RemoteQuery node correctlyPavan Deolasee
We never had this support and we never felt the need because the use of FQS was limited for utility statements and simple queries which can be completed pushed down to the remote node. But in PG 10, we're seeing errors while using cursors for queries which are FQSed. So instead of forcing regular remote subplan on such queries, we are adding support for rescan of RemoteQuery node. Patch by Senhu <[email protected]>
2017-08-22Do not FQS NextValueExprPavan Deolasee
The target datanode must be determined after computing the next value. So let is go through regular planning. This fixes couple of regression failures.
2017-08-21Fix portals test casePavan Deolasee
Accept expected output changes which were missed because we've an alternate expected output file which is not merged automatically. The changes simply include an additional Project node in the explain node.
2017-08-21Fix insert test casePavan Deolasee
Various things are done to ensure that the test case passes. Some of these changes are not truly correct because we might not be testing what the original test case was supposed to test, but given the limitations that we've imposed on partition table column positions etc, this is inevitable - accept some output changes because certain features (such as triggers) not supported. - make changes to column ordering so that partitions can be attached - avoid dropping/adding columns which will change column ordering - accept additional information displayed by \d+ command
2017-08-21Make sure coordinator_lxid is formatted as %u and not %dTomas Vondra
As the coordinator_lxid is uin32, so make sure we use %u to format it (e.g. when sending it to remote nodes as string) and not just %d.
2017-08-21Define coordinator_lxid GUC as unsigned integerTomas Vondra
The coordinator_lxid GUC is internally stored as uint32, but was defined as plaint int32, triggering a compiler warning. It's also unclear what would happen for transaction IDs outside the signed range (possibly some strange issues). This adds a new GUC type (UInt), used only for this one GUC. The patch is fairly large, but most of it is boilerplate infrastructure to support the new GUC type. We have considered simpler workarounds (e.g. treating the GUC as string and converting it to/from uint32 using the GUC hooks, but this seems much cleaner and tidier.
2017-08-21Make sure ExecRemoteQuery is called with (PlanState *) parameterTomas Vondra
gcc 6.4.1 is complaining when ExecRemoteQuery(PlanState *) gets called with (RemoteSubqueryState*) parameter. This commit adds explicit cast on a few places to silence the warnings noise. An alternative fix might be to use (RemoteSubqueryState*), but that does not quite work as ResponseCombiner needs to keep a pointer to either ExecRemoteQuery or ExecRemoteSubplan. So the explicit cast seems better.
2017-08-21Handle params correctly within Subplan nodesPavan Deolasee
We were not dealing with the params in Subplan correctly, thus those params were not sent to the remote nodes correctly during RemoteSubplan exectution. This patch fixes that by traversing the Subplan node correctly. The regression failure in the 'join' test case is addressed too. Patch by senhu ([email protected])
2017-08-18Generate a DEFAULT clause for identity columnsPavan Deolasee
Recent changes in PG 10 generates a nextval() expression (there was no support for NextValExpr in ruleutils before that). But that fails on the datanode side because only DEFAULT values are accepted for identity columns, unless overridden. This patch restores the XL behaviour, thus helping the regression.
2017-08-18Accept some trivial regression diffs after the last mergePavan Deolasee