postgres-xl.git
9 years agoFix a few regression test failures post cherry picking of patches.
Pavan Deolasee [Tue, 25 Oct 2016 08:44:12 +0000 (14:14 +0530)]
Fix a few regression test failures post cherry picking of patches.

9 years agoMake entirely-dummy appendrels get marked as such in set_append_rel_size.
Tom Lane [Sun, 26 Jul 2015 20:19:08 +0000 (16:19 -0400)]
Make entirely-dummy appendrels get marked as such in set_append_rel_size.

The planner generally expects that the estimated rowcount of any relation
is at least one row, *unless* it has been proven empty by constraint
exclusion or similar mechanisms, which is marked by installing a dummy path
as the rel's cheapest path (cf. IS_DUMMY_REL).  When I split up
allpaths.c's processing of base rels into separate set_base_rel_sizes and
set_base_rel_pathlists steps, the intention was that dummy rels would get
marked as such during the "set size" step; this is what justifies an Assert
in indxpath.c's get_loop_count that other relations should either be dummy
or have positive rowcount.  Unfortunately I didn't get that quite right
for append relations: if all the child rels have been proven empty then
set_append_rel_size would come up with a rowcount of zero, which is
correct, but it didn't then do set_dummy_rel_pathlist.  (We would have
ended up with the right state after set_append_rel_pathlist, but that's
too late, if we generate indexpaths for some other rel first.)

In addition to fixing the actual bug, I installed an Assert enforcing this
convention in set_rel_size; that then allows simplification of a couple
of now-redundant tests for zero rowcount in set_append_rel_size.

Also, to cover the possibility that third-party FDWs have been careless
about not returning a zero rowcount estimate, apply clamp_row_est to
whatever an FDW comes up with as the rows estimate.

Per report from Andreas Seltenreich.  Back-patch to 9.2.  Earlier branches
did not have the separation between set_base_rel_sizes and
set_base_rel_pathlists steps, so there was no intermediate state where an
appendrel would have had inconsistent rowcount and pathlist.  It's possible
that adding the Assert to set_rel_size would be a good idea in older
branches too; but since they're not under development any more, it's likely
not worth the trouble.

9 years agoFix regression framework so that "make check" runs
Pavan Deolasee [Tue, 18 Oct 2016 11:37:50 +0000 (17:07 +0530)]
Fix regression framework so that "make check" runs

9 years agoFix compilation issues
Pavan Deolasee [Tue, 18 Oct 2016 10:57:13 +0000 (16:27 +0530)]
Fix compilation issues

9 years agoRedesign tablesample method API, and do extensive code review.
Tom Lane [Sat, 25 Jul 2015 18:39:00 +0000 (14:39 -0400)]
Redesign tablesample method API, and do extensive code review.

The original implementation of TABLESAMPLE modeled the tablesample method
API on index access methods, which wasn't a good choice because, without
specialized DDL commands, there's no way to build an extension that can
implement a TSM.  (Raw inserts into system catalogs are not an acceptable
thing to do, because we can't undo them during DROP EXTENSION, nor will
pg_upgrade behave sanely.)  Instead adopt an API more like procedural
language handlers or foreign data wrappers, wherein the only SQL-level
support object needed is a single handler function identified by having
a special return type.  This lets us get rid of the supporting catalog
altogether, so that no custom DDL support is needed for the feature.

Adjust the API so that it can support non-constant tablesample arguments
(the original coding assumed we could evaluate the argument expressions at
ExecInitSampleScan time, which is undesirable even if it weren't outright
unsafe), and discourage sampling methods from looking at invisible tuples.
Make sure that the BERNOULLI and SYSTEM methods are genuinely repeatable
within and across queries, as required by the SQL standard, and deal more
honestly with methods that can't support that requirement.

Make a full code-review pass over the tablesample additions, and fix
assorted bugs, omissions, infelicities, and cosmetic issues (such as
failure to put the added code stanzas in a consistent ordering).
Improve EXPLAIN's output of tablesample plans, too.

Back-patch to 9.5 so that we don't have to support the original API
in production.

9 years agoEnsure we're not going beyond the configured limits of max_coordinators or
Pavan Deolasee [Tue, 18 Oct 2016 06:30:41 +0000 (12:00 +0530)]
Ensure we're not going beyond the configured limits of max_coordinators or
max_datanodes

The user can still break things by first setting a high value for max_datanodes
or max_coordinators and then lowering it again after adding nodes. So this
basic check is not enough, but better than what we've currently.

9 years agoUse OS timestamp for computing if the current statement has taken more than
Pavan Deolasee [Tue, 18 Oct 2016 05:18:39 +0000 (10:48 +0530)]
Use OS timestamp for computing if the current statement has taken more than
log_min_statement_duration for execution

Since we compare the statement start time with the one obtained by
GetCurrentTimestamp(), which returns OS time without any adjustments for clock
skew, it seems fair to use statement start time obtained by the same clock.

9 years agoUse version string from the server for pgxc_ctl
Pavan Deolasee [Fri, 14 Oct 2016 10:19:49 +0000 (15:49 +0530)]
Use version string from the server for pgxc_ctl

9 years agoFix an oversight in a5b53b0dda52 where we failed to track whether parameter
Pavan Deolasee [Tue, 4 Oct 2016 07:50:45 +0000 (13:20 +0530)]
Fix an oversight in a5b53b0dda52 where we failed to track whether parameter
value has been computed or not at all places

Report and test case by Agoston David

9 years agoCorrectly initialise coordMaxWALSenders and datanodeMaxWALSenders while adding
Pavan Deolasee [Tue, 4 Oct 2016 05:27:00 +0000 (10:57 +0530)]
Correctly initialise coordMaxWALSenders and datanodeMaxWALSenders while adding
new nodes via pgxc_ctl

9 years agoAllow COMMIT/ROLLBACK PREPARED xact to succeed on the local coordinator even if
Pavan Deolasee [Fri, 30 Sep 2016 10:17:36 +0000 (15:47 +0530)]
Allow COMMIT/ROLLBACK PREPARED xact to succeed on the local coordinator even if
the GTM no longer has state information for the transaction when
xc_maintenance_mode is active.

Information on the GTM is important for explicit prepared transactions because
GTM tracks the participants nodes in that case and the COMMIT/ROLLBACK PREPARED
commands can then to forwarded to those participants. So when
xc_maintenance_mode is active, we only cleanup prepared transaction on the
local node (or remote when used with EXECUTE DIRECT). So it seems ok not to
guarantee the GTM to have the state information.

9 years agoHandle remote parameters correctly by sending then down to the remote nodes in
Pavan Deolasee [Thu, 29 Sep 2016 05:27:19 +0000 (10:57 +0530)]
Handle remote parameters correctly by sending then down to the remote nodes in
the correct order and correction position

Per report and test-case by Daniel Bunford-Jones

9 years agoMake another attempt to fix vpath build for pgxc_ctl contrib module
Pavan Deolasee [Fri, 16 Sep 2016 07:07:04 +0000 (12:37 +0530)]
Make another attempt to fix vpath build for pgxc_ctl contrib module

9 years agoFix VPATH build for contrib/pgxc_ctl
Pavan Deolasee [Thu, 15 Sep 2016 09:09:57 +0000 (14:39 +0530)]
Fix VPATH build for contrib/pgxc_ctl

9 years agoProperly quote database name while dropping it on remote node
Pavan Deolasee [Wed, 7 Sep 2016 04:55:52 +0000 (10:25 +0530)]
Properly quote database name while dropping it on remote node

Per bug report by Răzvan-Sebastian Botez

9 years agoRevert a change accidentally got checked in during merge bbf2fec2. Regressions
Pavan Deolasee [Tue, 6 Sep 2016 05:29:55 +0000 (10:59 +0530)]
Revert a change accidentally got checked in during merge bbf2fec2. Regressions
show no additional failures.

Thanks Tomas Vondra for spotting this.

9 years agorename adjustSubplanDistribution() to adjust_subplan_distribution()
Tomas Vondra [Sun, 28 Aug 2016 11:16:17 +0000 (13:16 +0200)]
rename adjustSubplanDistribution() to adjust_subplan_distribution()

A cosmetic change to so that the whole file uses the same naming style.

9 years agoremove enable_remotejoin and enable_remotegroup C variables
Tomas Vondra [Sun, 28 Aug 2016 03:10:55 +0000 (05:10 +0200)]
remove enable_remotejoin and enable_remotegroup C variables

None of those variables was referenced in C code, and there are
no GUC variables matching them, so it's a dead code.

Those variables are still referenced in three sets of regression
tests - rangefuncs, xc_limit and xc_sort.

For rangefuncs the reference is however only in one of multiple
possible outputs (and apparently we pick another one), and the
other two regression tests are not part of any test schedule.

9 years agoremove unused functions from pgxcpath.c
Tomas Vondra [Sun, 28 Aug 2016 02:53:49 +0000 (04:53 +0200)]
remove unused functions from pgxcpath.c

The following three functions defined in pgxcpath.c were not referenced
from anywhere, so let's remove them

- create_plainrel_rqpath
- create_joinrel_rqpath
- pgxc_find_remotequery_path

Both create_* functions were external, but none of them was listed in
any header file, so there's no chance they migh be called from some
external tool (also, if we have no callers, we can't test the code).

9 years agoadd an assert to create_remotequery_path for RELOPT_BASEREL case
Tomas Vondra [Sun, 28 Aug 2016 02:48:11 +0000 (04:48 +0200)]
add an assert to create_remotequery_path for RELOPT_BASEREL case

Make sure that for base relations, both the paths (left and right)
and join restrictlist are NULL (or NIL for the list). I'm not sure
if this is true for RELOPT_OTHER_MEMBER_REL also, so only do this
for RELOPT_BASEREL.

Perhaps we should also convert the inverse condition (for join
relations) to an assert - currently it's an if condition:

  if (rel->reloptkind == RELOPT_JOINREL && (!leftpath || !rightpath))
    ...

but I've left that alone for now.

9 years agominor create_remotequery_path improvement, rename RemoteQueryPath fields
Tomas Vondra [Sun, 28 Aug 2016 02:39:32 +0000 (04:39 +0200)]
minor create_remotequery_path improvement, rename RemoteQueryPath fields

The RemoteQueryPath structure includes three flags tracking features of
the path - originally, those were called

- rqhas_unshippable_qual
- rqhas_temp_rel
- rqhas_unshippable_tlist

which is a bit awkward because we already know it's part of RemoteQuery,
so the 'rq' prefix is redundant. So I've renamed them to

- has_unshippable_qual
- has_temp_rel
- has_unshippable_tlist

Also, reformat/reword the comment a bit.

9 years agofix pgxcpath.c header comment
Tomas Vondra [Sun, 28 Aug 2016 02:27:04 +0000 (04:27 +0200)]
fix pgxcpath.c header comment

9 years agochange tts_tupleDescriptor/tts_datarow checks into asserts
Tomas Vondra [Sat, 27 Aug 2016 23:32:44 +0000 (01:32 +0200)]
change tts_tupleDescriptor/tts_datarow checks into asserts

The following check at the beginning of slot_deform_datarow

    if (slot->tts_tupleDescriptor == NULL || slot->tts_datarow == NULL)
        return;

was replaced with two asserts, enforcing the same conditions (except
that instead of silently returning it'll cause failure).

Silently ignoring such condition seems quite suspicious, and likely
only masks other errors - for example why should it be OK to call
this function without a data row?

This change seems safe, because all current callers already access
tts_tupleDescriptor - for example in the fastpath checks - and so
this field can't ever be NULL here. Also, we only call this function
after explicitly checking tts_datarow, so that can't be NULL either.

9 years agominor fixes in slot_deform_datarow - comment and attnum/natts rename
Tomas Vondra [Sat, 27 Aug 2016 23:13:27 +0000 (01:13 +0200)]
minor fixes in slot_deform_datarow - comment and attnum/natts rename

Added a comment explaining possible optimization when deforming
a DataRow message. Also renamed 'attnum' to 'natts' to more clearly
show the intent (attribute number vs. number of attributes).

9 years agoremove genbki.sh shell script
Tomas Vondra [Sun, 28 Aug 2016 00:26:14 +0000 (02:26 +0200)]
remove genbki.sh shell script

It was replaced with genbki.pl for all catalogs.

9 years agoremove unnecessary header changes from indexam.c
Tomas Vondra [Sun, 28 Aug 2016 00:04:41 +0000 (02:04 +0200)]
remove unnecessary header changes from indexam.c

9 years agoremove get_parsed_hba() - not needed after removing contrib/pghba
Tomas Vondra [Sun, 28 Aug 2016 20:30:27 +0000 (22:30 +0200)]
remove get_parsed_hba() - not needed after removing contrib/pghba

contrib/pghba was the sole used of the function. After removing it,
both hba.c and hba.h are clean copies from upstream, so also remove
the copyright notice from the .c file.

9 years agoadd pgxc_monitor to Makefile
Tomas Vondra [Wed, 24 Aug 2016 10:12:24 +0000 (12:12 +0200)]
add pgxc_monitor to Makefile

The pgxc_monitor contrib module was not included in the Makefile, thus
vulnerable to undetected compile breakage. That's not desiable, so add
it to the Makefile.

9 years agoremove pghba contrib module
Tomas Vondra [Wed, 24 Aug 2016 10:05:24 +0000 (12:05 +0200)]
remove pghba contrib module

The purpose of the module is unknown, and it does not even compile
for quite some time, so apparently no one uses it. Instead of fixing
it, let's remove it - if someone realizes it's useful, we can get
it from history.

9 years agoremove unused copy of gtm_opt_handler.c in src/gtm/config
Tomas Vondra [Wed, 24 Aug 2016 12:08:34 +0000 (14:08 +0200)]
remove unused copy of gtm_opt_handler.c in src/gtm/config

There's another copy of the file(s) in src/gtm/common.

9 years agoremove pgxc/pool/postgresql_fdw.c as is_immutable_func() is unused
Tomas Vondra [Wed, 24 Aug 2016 11:12:40 +0000 (13:12 +0200)]
remove pgxc/pool/postgresql_fdw.c as is_immutable_func() is unused

There was only a single function in this module, and it was not
referenced from anywhere. So remove the module and all references
to it (e.g. includes of the header).

In createplan.c, this is a bit more difficult, because it got
getpid() through this file, so include the pgxcnode.h instead,
as it uncludes unistd.h.

9 years agoremove stormutils, containing only stormdb_promote_standby() function
Tomas Vondra [Wed, 24 Aug 2016 10:40:05 +0000 (12:40 +0200)]
remove stormutils, containing only stormdb_promote_standby() function

Although stormdb_promote_standby() is a function visible from SQL,
it does not seem mentioned anywhere (e.g. in the docs etc.). So
let's get rid of it, as it's apparently not needed.

9 years agoadd barrierdesc.c to gitignore in pg_xlogdump
Tomas Vondra [Tue, 23 Aug 2016 16:49:33 +0000 (18:49 +0200)]
add barrierdesc.c to gitignore in pg_xlogdump

9 years agorefactor DoRefreshRemoteHandles a bit to get rid of compiler warnings
Tomas Vondra [Tue, 23 Aug 2016 12:47:14 +0000 (14:47 +0200)]
refactor DoRefreshRemoteHandles a bit to get rid of compiler warnings

As written originally, the branching confused the compiler enough to
emit warning about using uninitialized allOids variable. Refactor the
code a bit to make it clear that's not really possible, and also move
a number of variable declarations from the function scope to a block
level.

Note: I think the function would deserve more documentation - both
about the intent in general, and about the meaning of the return
value ('res' is quite unclear name).

9 years agorework GetPoolManagerHandle a bit to get rid of compiler warnings
Tomas Vondra [Tue, 23 Aug 2016 13:43:04 +0000 (15:43 +0200)]
rework GetPoolManagerHandle a bit to get rid of compiler warnings

Under rare conditions (missing support for unix sockets or empty
Unix_socket_directories) the fdsocket variable remained unitialized.
Handle this case explicitly, and also fix a few minor annoyances
(remove extra braces around a single-line block).

9 years agorefactor agent_handle_input() by splitting it into smaller pieces
Tomas Vondra [Tue, 23 Aug 2016 14:25:33 +0000 (16:25 +0200)]
refactor agent_handle_input() by splitting it into smaller pieces

When handling of a message type requires more than a few lines,
move it to a separate function. This makes the code flow much
cleaner, and it also issues with reusing shared variables
(originally defined at the function scope).

Also differentiate between EOF and protocol violation, if only
to log the protocol violation.

Note: The for(;;) loop checks for EOF on two places - once in the
switch, and then at the very end (using pool_pollbyte). There's
a subtle difference - the second place does not do agent_destroy.
Not sure if this is intentional, but perhaps that's a bug?

9 years agominor PgxcNodeListAndCount() refactoring to fix compiler warnings
Tomas Vondra [Tue, 23 Aug 2016 16:36:13 +0000 (18:36 +0200)]
minor PgxcNodeListAndCount() refactoring to fix compiler warnings

While tweaking the code, I've noticed this is the only place using
NodeHealthStatus, apparently attempting to save a few bytes. That
seems rather pointless given how little memory this will need and
how short-lived the memory is (and also how AllocSet doubles the
allocation sizes anyway), so I got rid of this. This makes copying
the old state easier (a simple memcpy instead of for loops).

Note: The PgxcNodeListAndCount() seems a bit unfortunate, as the
name suggests to list and count nodes, but in practice it refreshes
the status of nodes from catalog, while keeping the health status.

9 years agoRemove a portion of remote query deparsing code which is not used in XL anymore
Pavan Deolasee [Fri, 26 Aug 2016 11:27:59 +0000 (16:57 +0530)]
Remove a portion of remote query deparsing code which is not used in XL anymore

9 years agocast contain_mutable_functions() parameters to (Node*)
Tomas Vondra [Tue, 23 Aug 2016 15:57:57 +0000 (17:57 +0200)]
cast contain_mutable_functions() parameters to (Node*)

When calling the function for a target list, the compiler complains
because it expects (Node*) but gets (List*). So fix that simply by
casting to (Node*).

Also fix a trivial typo in preprocess_rowmarks() - double semicolon,
triggering warning about mixed declarations and code.

9 years agoinitialize 'pids' variable explicitly in agent_handle_input
Tomas Vondra [Tue, 23 Aug 2016 13:48:41 +0000 (15:48 +0200)]
initialize 'pids' variable explicitly in agent_handle_input

Otherwise the agent_acquire_connections() might bail out before
actually setting pids to anything, leaving the pointer set to
some random garbade, causing segfault at pfree() time.

9 years agocast connection to (PGconn*) in grow_pool() to fix compiler warning
Tomas Vondra [Tue, 23 Aug 2016 13:47:22 +0000 (15:47 +0200)]
cast connection to (PGconn*) in grow_pool() to fix compiler warning

9 years agosimplify slot_deform_datarow by using VARSIZE_ANY
Tomas Vondra [Tue, 23 Aug 2016 08:45:16 +0000 (10:45 +0200)]
simplify slot_deform_datarow by using VARSIZE_ANY

Replace the slightly complex branching with VARSIZE_ANY, which does
exactly the same thing. Also, ditch the pointless '#ifdef PGXC'
around the function.

9 years agofix type mismatch in slot_deform_datarow (void* vs. Datum)
Tomas Vondra [Tue, 23 Aug 2016 08:39:02 +0000 (10:39 +0200)]
fix type mismatch in slot_deform_datarow (void* vs. Datum)

The pfree() expects void*, but was getting pointer packed as a Datum.
So instead use 'val' with the Datum converted as a pointer, and also
ditch the pointless null check (we're doing memcpy from the pointer
so we'd get segfault anyway).

9 years agoinitialize saved_gxid and saved_global_gxid in GTM_RestoreTxnInfo
Tomas Vondra [Tue, 23 Aug 2016 08:26:36 +0000 (10:26 +0200)]
initialize saved_gxid and saved_global_gxid in GTM_RestoreTxnInfo

Without the control file (ctlf==NULL), the two gxid variables were
not initialized. Set them both to InvalidGlobalTransactionId.

9 years agoreduce the size of shippability API
Tomas Vondra [Mon, 22 Aug 2016 21:47:49 +0000 (23:47 +0200)]
reduce the size of shippability API

A significant part of the shippability API defined in pgxcship.h was
actually used only from within pgxcship.c, so make as many functions
static (instead of extern) as possible:

- pgxc_is_func_shippable
- pgxc_find_dist_equijoin_qual
- pgxc_merge_exec_nodes
- pgxc_query_has_distcolgrouping

This also shown that two functions are indeed unused:

- pgxc_check_index_shippability
- pgxc_check_fk_shippability

so remove them entirely.

9 years agoremove unused shippability definitions from planner.h
Tomas Vondra [Mon, 22 Aug 2016 21:38:31 +0000 (23:38 +0200)]
remove unused shippability definitions from planner.h

The ShippabilityStat type and shippability walker/test functions are not
really needed outside pgxcship.c.

9 years agoremove unused GUC options - strict_statement_checking and enforce_two_phase_commit
Tomas Vondra [Mon, 22 Aug 2016 22:05:24 +0000 (00:05 +0200)]
remove unused GUC options - strict_statement_checking and enforce_two_phase_commit

These two options were ineffective - defined and listed in the sample
configuration file, but attached to unreferenced variables.

9 years agofix transposed parameters when calling memset in gtm_utils.c
Tomas Vondra [Mon, 22 Aug 2016 22:09:37 +0000 (00:09 +0200)]
fix transposed parameters when calling memset in gtm_utils.c

The intent of the memset() call apparently was to zaro the memory,
but as the third parameter was 0 by mistake, it failed to do so.

9 years agoDraft release notes for Postgres-XL 9.5r1.3 release
Pavan Deolasee [Tue, 16 Aug 2016 05:05:07 +0000 (10:35 +0530)]
Draft release notes for Postgres-XL 9.5r1.3 release

9 years agoMake adjustments to the expected output of 'brin' test case
Pavan Deolasee [Tue, 16 Aug 2016 04:06:46 +0000 (09:36 +0530)]
Make adjustments to the expected output of 'brin' test case

9 years agoMake sure ON COMMIT actions are invoked only when transaction is still valid
Pavan Deolasee [Tue, 16 Aug 2016 04:01:29 +0000 (09:31 +0530)]
Make sure ON COMMIT actions are invoked only when transaction is still valid

Per report by Agoston David

9 years agoCorrect aggregation function for "money" data type.
Pavan Deolasee [Fri, 12 Aug 2016 09:49:46 +0000 (15:19 +0530)]
Correct aggregation function for "money" data type.

Per report by Sergio Hernández Martínez

9 years agoDisallow FOR UPDATE/SHARE for queries using SQL JOIN syntax.
Pavan Deolasee [Fri, 12 Aug 2016 09:32:29 +0000 (15:02 +0530)]
Disallow FOR UPDATE/SHARE for queries using SQL JOIN syntax.

Shaun Thomas had reported the original and our last attempt to block FOR
UPDATE/SHARE when invoked on more than one table wasn't enough. Hopefully
this takes care of all such occurances of the query. But we now allow FOR
UPDATE/SHARE if all tables involved in the query are replicated tables

9 years agoQuote default_transaction_isolation parameter while sending down to the remote
Pavan Deolasee [Thu, 11 Aug 2016 04:28:12 +0000 (09:58 +0530)]
Quote default_transaction_isolation parameter while sending down to the remote
nodes

Per report by Arun T K

9 years agoHonour WITH NO DATA clause of CREATE TABLE AS
Pavan Deolasee [Thu, 11 Aug 2016 03:45:36 +0000 (09:15 +0530)]
Honour WITH NO DATA clause of CREATE TABLE AS

9 years agoReport execution stats for each step of redistribution and also call
Pavan Deolasee [Fri, 5 Aug 2016 05:37:07 +0000 (11:07 +0530)]
Report execution stats for each step of redistribution and also call
tuplestore_end() at the end instead of just tuplestore_clear() which neither
frees up resources nor prints the stats

9 years agoEnsure that the statistics about all-visible pages in fetched from remote
Pavan Deolasee [Tue, 2 Aug 2016 03:20:38 +0000 (08:50 +0530)]
Ensure that the statistics about all-visible pages in fetched from remote
datanodes and updated at the coordinator for better planning.

We seemed to have missed fetching relallvisible all along and that can lead to
some bad planning at the coordinator. In particular, it may not use Index Only
scans where its possible. This is a long standing bug, but some other stats
collection (such as 8ca720f90f7) bug might have masked this problem until now.

Per report by Sergio Hernández Martínez, with investigation and patch by me.

9 years agoAdd test case for Issue #57
Pallavi Sontakke [Thu, 28 Jul 2016 07:59:48 +0000 (13:29 +0530)]
Add test case for Issue #57
When distribution column is changed for a table, we don't check for dependecies such as UNIQUE indexes

9 years agoAdd test case for Issue #27
Pallavi Sontakke [Thu, 28 Jul 2016 06:23:10 +0000 (11:53 +0530)]
Add test case for Issue #27
Distribution column can be dropped for MODULO distribution tables.

9 years agoAdd test case for Issue #6
Pallavi Sontakke [Thu, 28 Jul 2016 05:14:32 +0000 (10:44 +0530)]
Add test case for Issue #6
REFRESH MATERIALISED VIEW CONCURRENTLY gives error

9 years agoCorrect target release date for 9.5r1.2 release
Pavan Deolasee [Wed, 27 Jul 2016 08:11:48 +0000 (13:41 +0530)]
Correct target release date for 9.5r1.2 release

9 years agoAdd test case for Issue #74
Pallavi Sontakke [Wed, 27 Jul 2016 09:51:39 +0000 (15:21 +0530)]
Add test case for Issue #74
SQL error codes are not correctly sent back to
the client when dealing with error on COPY protocol

9 years agoAdd test case for Issue #70
Pallavi Sontakke [Wed, 27 Jul 2016 05:59:25 +0000 (11:29 +0530)]
Add test case for Issue #70
Role concurrently dropped error

9 years agoAdd test case for Issue #43
Pallavi Sontakke [Tue, 26 Jul 2016 11:34:58 +0000 (17:04 +0530)]
Add test case for Issue #43
Parallel analyze causes Unexpected response from the Datanodes

9 years agoAdd test case for Issue #13
Pallavi Sontakke [Tue, 26 Jul 2016 10:01:24 +0000 (15:31 +0530)]
Add test case for Issue #13
INSERT query with SELECT part using joins on OID fails to insert all rows correctly

9 years agoAdd test case for Issue #9
Pallavi Sontakke [Tue, 26 Jul 2016 07:02:20 +0000 (12:32 +0530)]
Add test case for Issue #9
Fails to see DDL's effect inside a function

9 years agoAdd test case for Issue #4
Pallavi Sontakke [Mon, 25 Jul 2016 11:46:41 +0000 (17:16 +0530)]
Add test case for Issue #4
Tableoid to relation name mapping broken

9 years agoExplicitly track if a subplan has been executed and a valid value is computed
Pavan Deolasee [Wed, 20 Jul 2016 10:06:14 +0000 (15:36 +0530)]
Explicitly track if a subplan has been executed and a valid value is computed
or not.

This works around a problem noted in issue #102, but not a full solution to the
problem. It seems there are places where InitPlan is attached to a node which
will be executed on the remote node. Even so coordinator tries to find push a
PARAM_EXEC parameter value for a remote subplan and fails because the value is
not and will never be computed on the coordinator. We for now send NULL value
for such cases to avoid a server crash

9 years agoCorrect stable function in test
Pallavi Sontakke [Wed, 20 Jul 2016 09:42:04 +0000 (15:12 +0530)]
Correct stable function in test

9 years agoAdd an alternate expected output file for "inherit" test case to address
Pavan Deolasee [Wed, 20 Jul 2016 07:42:14 +0000 (13:12 +0530)]
Add an alternate expected output file for "inherit" test case to address
occasional plan change

9 years agoDo not print node names in EXPLAIN output of a query in "rules" test since that
Pavan Deolasee [Wed, 20 Jul 2016 07:30:34 +0000 (13:00 +0530)]
Do not print node names in EXPLAIN output of a query in "rules" test since that
may cause non deterministic output

9 years agoWrite release notes for upcoming Postgres-XL 9.5r1.2 release
Pavan Deolasee [Wed, 20 Jul 2016 06:50:32 +0000 (12:20 +0530)]
Write release notes for upcoming Postgres-XL 9.5r1.2 release

9 years agoLoad balance remote subplan execution by choosing a node randomly instead of
Pavan Deolasee [Tue, 19 Jul 2016 12:10:20 +0000 (17:40 +0530)]
Load balance remote subplan execution by choosing a node randomly instead of
always picking up the first node.

When planner has a choice of executing a subplan on any of the remote nodes,
it always used to execute the subplan on the first node. That can cause
excessive load/number of connections on that node. This patch fixes that by
choosing a node randomly from the list of available nodes

9 years agoModify expected output of tests due to recent changes
Pallavi Sontakke [Wed, 20 Jul 2016 06:46:14 +0000 (12:16 +0530)]
Modify expected output of tests due to recent changes

9 years agoAdd test case for Issue #93
Pallavi Sontakke [Tue, 19 Jul 2016 12:00:21 +0000 (17:30 +0530)]
Add test case for Issue #93

9 years agoUse 2^32 modulo computation to convert signed integer to unsigned value since
Pavan Deolasee [Tue, 19 Jul 2016 10:51:27 +0000 (16:21 +0530)]
Use 2^32 modulo computation to convert signed integer to unsigned value since
abs() may give a different result.

This makes the redistribution code in sync with the way hash modulo is computed
elsewhere in the code

9 years agoAdd test case for Issue #91
Pallavi Sontakke [Tue, 19 Jul 2016 10:49:43 +0000 (16:19 +0530)]
Add test case for Issue #91

9 years agoAdd test case for Issue #88
Pallavi Sontakke [Tue, 19 Jul 2016 09:54:19 +0000 (15:24 +0530)]
Add test case for Issue #88

9 years agoAdd test case for Issue #87
Pallavi Sontakke [Tue, 19 Jul 2016 08:35:21 +0000 (14:05 +0530)]
Add test case for Issue #87

9 years agoAdd test case for Issue #7
Pallavi Sontakke [Tue, 19 Jul 2016 05:32:40 +0000 (11:02 +0530)]
Add test case for Issue #7

9 years agoAdd test case for Issue #5
Pallavi Sontakke [Tue, 19 Jul 2016 05:17:49 +0000 (10:47 +0530)]
Add test case for Issue #5

9 years agoAdd test case for Issue #81
Pallavi Sontakke [Fri, 15 Jul 2016 12:32:46 +0000 (18:02 +0530)]
Add test case for Issue #81

Create empty cluster and add nodes multiple times
to reproduce the issue. This issue occurs intermittently.

9 years agoAdd test case for Issue #16
Pallavi Sontakke [Fri, 15 Jul 2016 10:48:39 +0000 (16:18 +0530)]
Add test case for Issue #16

9 years agoAdd test case for SQLsmith Issue #102
Pallavi Sontakke [Fri, 15 Jul 2016 05:05:51 +0000 (10:35 +0530)]
Add test case for SQLsmith Issue #102

9 years agoDo not FQS EXECUTE DIRECT statements.
Pavan Deolasee [Tue, 12 Jul 2016 09:07:22 +0000 (14:37 +0530)]
Do not FQS EXECUTE DIRECT statements.

Executor is not prepared to handle that and its not necessary since EXECUTE
DIRECT implies direct execution on the target node anyways

9 years agoBlock FOR SHARE/UPDATE for queries involving joins
Pavan Deolasee [Tue, 12 Jul 2016 07:03:23 +0000 (12:33 +0530)]
Block FOR SHARE/UPDATE for queries involving joins

Per report from Shaun Thomas, we don't yet support row locking when query has a
join between tables. While it may sometimes give an error, worse it may
silently lock wrong rows leading to application logic failures. The feature is
currently blocked until we have bandwidth to diagnose further and come up with
a proper fix.

Also update reqression tests to include offending tests and update expected
output now that such queries throw errors

9 years agoCorrect expected behaior of test.
Pallavi Sontakke [Mon, 11 Jul 2016 09:48:14 +0000 (15:18 +0530)]
Correct expected behaior of test.

Test reproduces Issue #84 on crash recovery
and prepared transactions.

9 years agoChange several asserts checking for aggregate context to errors
Pavan Deolasee [Mon, 11 Jul 2016 08:29:50 +0000 (13:59 +0530)]
Change several asserts checking for aggregate context to errors

This should address the crash in assert-enabled build reported by Pallavi
Sontakke. SQLSmith tries to call various functions from system catalogs and
functions should be prepared to handle such calls.

9 years agoAdd a test case demonstrating an extremely slow join in XL, especially with the
Pavan Deolasee [Fri, 8 Jul 2016 05:29:53 +0000 (10:59 +0530)]
Add a test case demonstrating an extremely slow join in XL, especially with the
inner side of a join doing repeated remote subquery scans

9 years agoNever ever use an invalid XID, if we fail to connect to the GTM
Pavan Deolasee [Thu, 7 Jul 2016 11:26:20 +0000 (16:56 +0530)]
Never ever use an invalid XID, if we fail to connect to the GTM

The code before this commit would happily proceed further if GTM becomes dead
or unreachable. This may result in random problems since rest of the code is
not prepared to deal with that situation (as seen from the crash in TAP tests).
It seems far safer to just throw an error in such case.

TAP test and report by Pallavi Sontakke

9 years agoUse GTM_Sequence type to hold value of a sequence on GTM
Pavan Deolasee [Wed, 6 Jul 2016 18:14:05 +0000 (23:44 +0530)]
Use GTM_Sequence type to hold value of a sequence on GTM

We were incorrectly using "int" at couple of places which is not wide enough to
store 64-bit sequence values.

Per report by Helmi Ahmad

9 years agoReturn pointer to the buffer used to store various fields values, so that
Pavan Deolasee [Wed, 6 Jul 2016 10:21:44 +0000 (15:51 +0530)]
Return pointer to the buffer used to store various fields values, so that
caller can free up the memory when done with it.

This fixes a memory like while running ALTER TABLE DISTRIBUTE BY

9 years agoAdd a missing parenthesis, lack of which might throw surprises
Pavan Deolasee [Wed, 6 Jul 2016 10:20:21 +0000 (15:50 +0530)]
Add a missing parenthesis, lack of which might throw surprises

9 years agoDon't wait indefinitely while trying to abort a transaction on the remote node.
Pavan Deolasee [Wed, 6 Jul 2016 09:46:47 +0000 (15:16 +0530)]
Don't wait indefinitely while trying to abort a transaction on the remote node.

Treat this more as a work-around until we investigate the reasons for remote
nodes not honouring query cancellation for some complicated queries, requiring
nested remote subquery plans

9 years agoAvoid pushing down evaluation of VALUES clause to a datanode for replicated
Pavan Deolasee [Tue, 21 Jun 2016 12:56:34 +0000 (18:26 +0530)]
Avoid pushing down evaluation of VALUES clause to a datanode for replicated
tables, unless it contains volatile function(s)

9 years agoWarn about missing relations only if they are not views since views are not
Pavan Deolasee [Tue, 21 Jun 2016 08:06:49 +0000 (13:36 +0530)]
Warn about missing relations only if they are not views since views are not
created on datanodes anyways

This relates to the earlier commit

9 years agoAdd a warning when a node fails to find OID for the given relation.
Pavan Deolasee [Tue, 21 Jun 2016 05:47:23 +0000 (11:17 +0530)]
Add a warning when a node fails to find OID for the given relation.

Regression shows a bunch of warnings which should be fixed over due course

9 years agoHandle ON COMMIT properly on the datanodes by not looking at
Pavan Deolasee [Mon, 20 Jun 2016 12:10:50 +0000 (17:40 +0530)]
Handle ON COMMIT properly on the datanodes by not looking at
MyXactAccessedTempRel which is set up differently in XL

We can't rely on MyXactAccessedTempRel because it gets set only when local
buffers are used for a relation. In XL, even temp tables use shared buffers
when used in a global session. Skipping checking for this local flag won't be
too bad from performance perspective.

9 years agoAdd TAP test for crash recovery Issue #84
Pallavi Sontakke [Mon, 20 Jun 2016 11:53:31 +0000 (17:23 +0530)]
Add TAP test for crash recovery Issue #84

Test crash recovery when prepared transactions are being created in
the background. Tests #84.

9 years agoAdd test for complex-update issue #38
Pallavi Sontakke [Fri, 17 Jun 2016 09:09:21 +0000 (14:39 +0530)]
Add test for complex-update issue #38