Commit Graph

4749 Commits (expose/defer_marked_shards_API)

Author SHA1 Message Date
Önder Kalacı c760cd3470
Move local execution after remote execution (#4301)
* Move local execution after the remote execution

Before this commit, when both local and remote tasks
exist, the executor was starting the execution with
local execution. There is no strict requirements on
this.

Especially considering the adaptive connection management
improvements that we plan to roll soon, moving the local
execution after to the remote execution makes more sense.

The adaptive connection management for single node Citus
would look roughly as follows:

   - Try to connect back to the coordinator for running
     parallel queries.
        - If succeeds, go on and execute tasks in parallel
        - If fails, fallback to the local execution

So, we'll use local execution as a fallback mechanism. And,
moving it after to the remote execution allows us to implement
such further scenarios.
2020-11-24 13:43:38 +01:00
Onur Tirtir d15a4c15cf
Merge pull request #4341 from citusdata/update-cl-943
Update CHANGELOG for 9.4.3
2020-11-24 13:29:59 +03:00
Onur Tirtir 76a429f19b Update CHANGELOG for 9.4.3 2020-11-24 12:52:16 +03:00
Hadi Moshayedi fc0ef8abba
Merge pull request #4336 from citusdata/cstore_memory_leaks
Fix memory leaks in column store
2020-11-23 11:40:39 -08:00
Hadi Moshayedi 40b52ab757 Fix memory leaks in column store 2020-11-23 11:26:12 -08:00
Önder Kalacı 532b457554
Solidify the slow-start algorithm (#4318)
The adaptive executor emulates the TCP's slow start algorithm.
Whenever the executor needs new connections, it doubles the number
of connections established in the previous iteration.

This approach is powerful. When the remote queries are very short
(like index lookup with < 1ms), even a single connection is sufficent
most of the time. When the remote queries are long, the executor
can quickly establish necessary number of connections.

One missing piece on our implementation seems that the executor
keeps doubling the number of connections even if the previous
connection attempts have been finalized. Instead, we should
wait until all the attempts are finalized. This is how TCP's
slow-start works. Plus, it decreases the unnecessary pressure
on the remote nodes.
2020-11-23 19:20:13 +01:00
jeff-davis 2e70dbe40a
Merge pull request #4330 from citusdata/remove-fdw
remove columnar FDW code
2020-11-20 10:19:20 -08:00
Jeff Davis ba6ec610e2 address review comment 2020-11-20 10:03:12 -08:00
Jeff Davis 8cee2b092b remove columnar FDW code 2020-11-20 10:03:12 -08:00
Jelte Fennema b2def22ab1
Fix possible uninitialized variable warning (#4334)
I got this warning when compiling citus:
```
../columnar/write_state_management.c: In function ‘PendingWritesInUpperTransactions’:
../columnar/write_state_management.c:364:20: warning: ‘entry’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (found && entry->writeStateStack != NULL)
               ~~~~~^~~~~~~~~~~~~~~~
```

I fixed this by checking by always initializing entry, by using an early
return if `WriteStateMap` didn't exist. Instead of using the `found`
variable to check for existence of the key, I now simply check the
`entry` variable itself.

To quote the postgres comment on the hash_enter function:

> If foundPtr isn't NULL, then *foundPtr is set true if we found an
> existing entry in the table, false otherwise.  This is needed in the
> HASH_ENTER case, but is redundant with the return value otherwise.
2020-11-20 16:02:03 +01:00
Önder Kalacı 856e5c85cf
Merge pull request #4331 from citusdata/pre_executor_run
Do not execute subplans multiple times with cursors
2020-11-20 13:36:07 +01:00
Onder Kalaci c433c66f2b Do not execute subplans multiple times with cursors
Before this commit, we let AdaptiveExecutorPreExecutorRun()
to be effective multiple times on every FETCH on cursors.
That does not affect the correctness of the query results,
but adds significant overhead.
2020-11-20 10:43:56 +01:00
Önder Kalacı b0ddbbd33a
Enable parallel query on EXPLAIN ANALYZE (#4325)
It seems that we forgot to pass the revelant
flag to enable Postgres' parallel query
capabilities on the shards when user does
EXPLAIN ANALYZE on a distributed table.
2020-11-20 09:54:04 +01:00
Hadi Moshayedi c35f38459b
Merge pull request #4320 from citusdata/cstore_alter_table
Fix ALTER COLUMN ... TYPE for columnar
2020-11-19 15:58:15 -08:00
Hadi Moshayedi b182a95389 Fix ALTER COLUMN ... SET TYPE for columnar 2020-11-19 15:36:45 -08:00
jeff-davis 4e035b6044
Merge pull request #4328 from citusdata/rename
rename cstore_tableam -> columnar
2020-11-19 13:37:31 -08:00
Jeff Davis cef1d0e915 fixup test output 2020-11-19 12:45:52 -08:00
Jeff Davis 91015deb9d rename UDFs also 2020-11-19 12:27:40 -08:00
Jeff Davis a2b698a766 rename cstore_tableam -> columnar 2020-11-19 12:15:51 -08:00
SaitTalhaNisanci 05390729f9
Merge pull request #4327 from citusdata/initializeVariable
Initialize entry variable as NULL
2020-11-19 16:37:24 +03:00
Sait Talha Nisanci ddc8e6c702 Initialize entry variable as NULL 2020-11-19 15:23:39 +03:00
SaitTalhaNisanci 09f737d942
Merge pull request #4283 from citusdata/component_governance_config
Add component governance config
2020-11-19 13:27:46 +03:00
SaitTalhaNisanci 3dca29a4c3
Merge branch 'master' into component_governance_config 2020-11-19 13:16:01 +03:00
Sait Talha Nisanci 5f436e10d0 Add the NOTICE file 2020-11-18 17:49:01 +03:00
SaitTalhaNisanci 9c44911226
Improve error messages in shard pruning (#4324) 2020-11-18 17:16:06 +03:00
Hadi Moshayedi 021ed07f12
Merge pull request #4322 from citusdata/cstore_tests
Test more of SQL features with column store
2020-11-17 20:28:03 -08:00
Hadi Moshayedi 2747fd80ff Add prepared materialized view tests for columnar 2020-11-17 20:13:20 -08:00
Hadi Moshayedi 6711340ea6 Add prepared xact & stmt tests for columnar 2020-11-17 20:00:57 -08:00
Hadi Moshayedi 3088ccd62a
Merge pull request #4319 from citusdata/cstore_write_state_management
Implements write state management for tuple inserts.
2020-11-17 12:17:51 -08:00
Hadi Moshayedi 97cba2d5b6 Implements write state management for tuple inserts.
TableAM API doesn't allow us to pass around a state variable along all of the tuple inserts belonging to the same command. We require this in columnar store, since we batch them, and when we have enough rows we flush them as stripes.

To do that, we keep a (relfilenode) -> stack of (subxact id, TableWriteState) global mapping.

**Inserts**

Whenever we want to insert a tuple, we look up for the relation's relfilenode in this mapping. If top of the stack matches current subtransaction, we us the existing TableWriteState. Otherwise, we allocate a new TableWriteState and push it on top of stack.

**(Sub)Transaction Commit/Aborts**

When the subtransaction or transaction is committed, we flush and pop all entries matching current SubTransactionId.

When the subtransaction or transaction is committed, we pop all entries matching current SubTransactionId and discard them without flushing.

**Reads**

Since we might have unwritten rows which needs to be read by a table scan, we flush write states on SELECTs. Since flushing the write state of upper transactions in a subtransaction will cause metadata being written in wrong subtransaction, we ERROR out if any of the upper subtransactions have unflushed rows.

**Table Drops**

We record in which subtransaction the table was dropped. When committing a subtransaction in which table was dropped, we propagate the drop to upper transaction. When aborting a subtransaction in which table was dropped, we mark table as not deleted.
2020-11-17 12:07:16 -08:00
Nils Dijk 2e09116b30
Merge pull request #4311 from citusdata/merge-cstore
Merge cstore into the citus repo
2020-11-17 19:10:32 +01:00
Nils Dijk 725f4a37d0
change configure to not have options 2020-11-17 19:01:54 +01:00
Nils Dijk 22df8027b0
add extra output for multi_extension targeting pg11 2020-11-17 19:01:54 +01:00
Nils Dijk 7c891a01a9 create missing objects during upgrade path 2020-11-17 19:01:51 +01:00
Nils Dijk 2987535172
add pg upgrade tests verifying table am is created 2020-11-17 18:55:36 +01:00
Hadi Moshayedi 691fdb2c64
Don't grab in additional locks cstore code when truncating 2020-11-17 18:55:36 +01:00
Nils Dijk d065bb495d
Prepare downgrade script and bump development version to 10.0-1 2020-11-17 18:55:35 +01:00
Nils Dijk 3e5df81e89
remove use of banned api 2020-11-17 18:55:35 +01:00
Nils Dijk b6d4a1bbe2
fix style 2020-11-17 18:55:35 +01:00
Nils Dijk 3bb6554976
make tests run 2020-11-17 18:55:35 +01:00
Nils Dijk 213eb93e6d
make columnar compile and functionally working 2020-11-17 18:55:34 +01:00
Nils Dijk f89bd3eeb5
move columnar test files 2020-11-17 18:55:34 +01:00
Nils Dijk 30fbd877e7
remove readme that has outdated info 2020-11-17 18:55:34 +01:00
Nils Dijk 527d3ce0bb
move headers to include directory 2020-11-17 18:55:34 +01:00
Nils Dijk 5fe4c12d49 Add 'src/backend/columnar/' from commit '4339e911933ca2109db46014befdaccf77c5c13f'
git-subtree-dir: src/backend/columnar
git-subtree-mainline: 34de1f645c
git-subtree-split: 4339e91193
2020-11-17 18:55:06 +01:00
SaitTalhaNisanci 34de1f645c
Update failure test dependencies (#4284)
* Update failure test dependencies

There was a security alert for cryptography. The vulnerability was fixed
in 3.2.0. The vulnebarility:

"RSA decryption was vulnerable to Bleichenbacher timing vulnerabilities,
which would impact people using RSA decryption in online scenarios."

The fix:
58494b41d6

It wasn't enough to only update crpytography because mitm was
incompatible with the new version, so mitm is also upgraded.

The steps to do in local:
python -m pip install -U cryptography
python -m pip install -U mitmproxy
2020-11-17 19:16:08 +03:00
Önder Kalacı 0c0fc69f2a
Remove unused field (#4275) 2020-11-17 11:41:57 +01:00
Nils Dijk d0c6950d43
Merge pull request #4310 from citusdata/fix/enterprise-modules
add placeholder for enterprise modules
2020-11-11 16:22:23 +01:00
Nils Dijk 7d14800071
add placeholder for enterprise modules 2020-11-11 15:43:04 +01:00
Onur Tirtir 601e6baa96
Merge pull request #4307 from citusdata/citus-9.5.0-changelog-1604924343
Update CHANGELOG for 9.5.0
2020-11-11 16:42:10 +03:00