Commit Graph

6454 Commits (23f4406d7fbe4698fe5049f6cdeb76b3499c3450)

Author SHA1 Message Date
Gokhan Gulbiz 23f4406d7f
Merge remote-tracking branch 'upstream/multi-tenant-monitoring' into multi-tenant-monitoring-annotation-parsing 2023-03-15 08:18:21 +03:00
Gokhan Gulbiz 44fec55d58
Escape/Unescape sql comment chars 2023-03-15 08:11:07 +03:00
Gokhan Gulbiz 230a189c1f
Minor renamings and refactorings 2023-03-15 08:10:45 +03:00
Gokhan Gulbiz 5cedee7a7d
Add comment chars escaping 2023-03-15 08:09:24 +03:00
Gokhan Gulbiz 3a435e7c14
Fix attribute prefix 2023-03-15 08:08:33 +03:00
Halil Ozan Akgul 33265dd411 Fix indent 2023-03-14 17:44:33 +03:00
Halil Ozan Akgul 5e9e67e5bf Include update and delete queries 2023-03-14 15:52:36 +03:00
Halil Ozan Akgul 2aa30dd303 Remove citus_stats_tenants from tests 2023-03-14 12:42:45 +03:00
Halil Ozan Akgul 93fb53b72b Remove storage view 2023-03-14 10:53:27 +03:00
Halil Ozan Akgul bb1db823f7 Add tests 2023-03-13 19:41:55 +03:00
Gokhan Gulbiz c241af1eb9
Fix tenant statistics annotations normalization 2023-03-13 14:32:16 +03:00
Gokhan Gulbiz 596954622c
Indent 2023-03-13 14:31:41 +03:00
Gokhan Gulbiz 59990addd1
Validate attribute prefix existance on query string 2023-03-13 13:24:27 +03:00
Gokhan Gulbiz 0de2ebad3f
Validate input string length 2023-03-13 12:44:57 +03:00
Gokhan Gulbiz c7af2ff0ef
Normalize multiline sql comment statements 2023-03-13 12:36:02 +03:00
Gokhan Gulbiz d85c277404
Use strncpy_s instead of strncpy 2023-03-13 11:36:54 +03:00
Gokhan Gulbiz 81cf3cf408
Use palloc instead of malloc 2023-03-13 10:13:28 +03:00
Gokhan Gulbiz 7f0c502660
Replace strcpy with strcpy_s 2023-03-10 16:35:21 +03:00
Gokhan Gulbiz 64b6d7a44e
Merge remote-tracking branch 'upstream/multi-tenant-monitoring' into multi-tenant-monitoring-annotation-parsing 2023-03-10 16:29:12 +03:00
Halil Ozan Akgul fa181a8bfd fix indent 2023-03-10 12:38:56 +03:00
Halil Ozan Akgul e8d516f0f0 fix strcpy_s 2023-03-10 12:32:50 +03:00
Halil Ozan Akgul 4289d4a981 safe functions 2023-03-10 12:20:15 +03:00
Halil Ozan Akgul e32a24e94a fix 2023-03-10 11:20:44 +03:00
Halil Ozan Akgul 1249606972 fix indent 2023-03-10 11:15:27 +03:00
Halil Ozan Akgul ba32f827a9 fix 2023-03-10 11:14:05 +03:00
Halil Ozan Akgul c1a67c9aca Fix lock 2023-03-10 11:00:09 +03:00
Halil Ozan Akgul 2b55ecc167 declaration fix 2023-03-09 12:22:04 +03:00
Halil Ozan Akgul 6ea9d00971 new line 2023-03-09 12:19:29 +03:00
Halil Ozan Akgul e9017b085b indent 2023-03-09 12:16:00 +03:00
Halil Ozan Akgul e8b31058e7 open locks 2023-03-09 12:12:28 +03:00
Halil Ozan Akgul 963712897b failure 2 2023-03-09 11:54:57 +03:00
Halil Ozan Akgul ea9cb77569 failure 1 2023-03-09 11:39:03 +03:00
Gokhan Gulbiz 6b46403675
Introduce JSON based annotation parsing 2023-03-09 11:20:55 +03:00
Gokhan Gulbiz d7dee1d001
Add ExtractFieldInt32(..) to jsonbutils 2023-03-09 11:20:32 +03:00
Halil Ozan Akgul 08d82ce8bb upgrade list 2023-03-09 11:18:46 +03:00
Halil Ozan Akgul 2bf52adb35 downgrade queries 2023-03-09 11:02:28 +03:00
Halil Ozan Akgul b41e848aa6 dnm3 2023-03-08 17:13:46 +03:00
Halil Ozan Akgul a5d0e4561c dnm2 2023-03-08 16:50:30 +03:00
Halil Ozan Akgul cb39c1f677 dnm 2023-03-08 16:32:50 +03:00
Halil Ozan Akgul ff66234ca2 try without locks 2023-03-07 15:33:52 +03:00
Halil Ozan Akgul 4816817c9b fix 2023-03-06 17:30:40 +03:00
Halil Ozan Akgul 01eb68a7c9 indent 2023-03-06 17:25:30 +03:00
Halil Ozan Akgul 4ebac440f9 Minor fix 2023-03-06 17:25:30 +03:00
Halil Ozan Akgul f7a479d2e4 Add locks and convert to static shared memory 2023-03-06 17:25:30 +03:00
Halil Ozan Akgul 4dfb9c6694 Add multi tenant monitoring 2023-03-06 17:25:30 +03:00
Nils Dijk 552b7f59b8 prototype tenant attributable cpu util 2023-03-06 17:25:30 +03:00
Ahmet Gedemenli 03f1bb70b7
Rebalance shard groups with placement count less than worker count (#6739)
DESCRIPTION: Adds logic to distribute unbalanced shards

If the number of shard placements (for a colocation group) is less than
the number of workers, it means that some of the workers will remain
empty. With this PR, we consider these shard groups as a colocation
group, in order to make them be distributed evenly as much as possible
across the cluster.

Example:
```sql
create table t1 (a int primary key);
create table t2 (a int primary key);
create table t3 (a int primary key);
set citus.shard_count =1;
select create_distributed_table('t1','a');
select create_distributed_table('t2','a',colocate_with=>'t1');
select create_distributed_table('t3','a',colocate_with=>'t2');

create table tb1 (a bigint);
create table tb2 (a bigint);
select create_distributed_table('tb1','a');
select create_distributed_table('tb2','a',colocate_with=>'tb1');

select citus_add_node('localhost',9702);
select rebalance_table_shards();
```

Here we have two colocation groups, each with one shard group. Both
shard groups are placed on the first worker node. When we add a new
worker node and try to rebalance table shards, the rebalance planner
considers it well balanced and does nothing. With this PR, the
rebalancer tries to distribute these shard groups evenly across the
cluster as much as possible. For this example, with this PR, the
rebalancer moves one of the shard groups to the second worker node.

fixes: #6715
2023-03-06 14:14:27 +03:00
Emel Şimşek ed7cc8f460
Remove unused lock functions (#6747)
Code cleanup. This change removes two unused functions seemingly left
over after a previous refactoring of shard move code.
2023-03-06 13:59:45 +03:00
Jelte Fennema b489d763e1
Use pg_total_relation_size in citus_shards (#6748)
DESCRIPTION: Correctly report shard size in citus_shards view

When looking at citus_shards, people are interested in the actual size
that all the data related to the shard takes up on disk.
`pg_total_relation_size` is the function to use for that purpose. The
previously used `pg_relation_size` does not include indexes or TOAST.
Especially the missing toast can have enormous impact on the size of the
shown data.
2023-03-06 10:53:12 +01:00
Gledis Zeneli dc7fa0d5af
Fix multiple output version arbitrary config tests (#6744)
With this small change, arbitrary config tests can have multiple acceptable correct outputs.

For an arbitrary config tests named `t`, now you can define `expected/t.out`, `expected/t_0.out`, `expected/t_1.out` etc and the test will succeed if the output of `sql/t.sql` is equal to any of the `t.out` or `t_{0, 1, ...}.out` files.
2023-03-03 21:06:59 +03:00