Commit Graph

6865 Commits (afa60556fd4e5b3097b7bb89307bff8480bbca12)

Author SHA1 Message Date
gindibay afa60556fd Fixes review comments 2023-11-09 01:43:08 +03:00
Gürkan İndibay 75589d1c11
Apply suggestions from code review
Co-authored-by: Jelte Fennema-Nio <jelte.fennema@microsoft.com>
2023-11-08 17:38:43 +03:00
gindibay 5f8f1d312d Fixes message errors 2023-11-08 06:56:21 +03:00
gindibay ba377ecaab Fixes tests 2023-11-08 03:23:34 +03:00
gindibay 65660db10d Fixes review items 2023-11-08 02:02:00 +03:00
Gürkan İndibay 595d078f95
Merge branch 'main' into create_alter_database 2023-11-01 13:30:09 +03:00
Jelte Fennema-Nio 20ae42e7fa
Fix flaky multi_reference_table test (#7294)
Sometimes multi_reference_table failed in CI like this:

```diff
 \c - - - :master_port
 DROP INDEX reference_schema.reference_index_2;
 \c - - - :worker_1_port
 SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='reference_schema.reference_table_ddl_1250019'::regclass;
- Column  |            Type             |  Modifiers
----------------------------------------------------------------------
- value_2 | double precision            | default 25.0
- value_3 | text                        | not null
- value_4 | timestamp without time zone |
- value_5 | double precision            |
-(4 rows)
-
+ERROR:  schema "citus_local_table_queries" does not exist
 \di reference_schema.reference_index_2*
           List of relations
  Schema | Name | Type | Owner | Table
```

Source:
https://github.com/citusdata/citus/actions/runs/6707535961/attempts/2#summary-18226879513

Reading from table_desc apparantly has an issue that if the schema gets
deleted from one of the items, while it is being read that we get such
an error.

This change fixes that by not running multi_reference_table in parallel
with citus_local_tables_queries anymore.
2023-11-01 10:12:06 +00:00
Cédric Villemain 37415ef8f5
Allow citus_*_size on index related to a distributed table (#7271)
I just enhanced the existing code to check if the relation is an index
belonging to a distributed table.
If so the shardId is appended to relation (index) name and the *_size
function are executed as before.

There is a change in an extern function:
  `extern StringInfo GenerateSizeQueryOnMultiplePlacements(...)`
It's possible to create a new function and deprecate this one later if
compatibility is an issue.

Fixes https://github.com/citusdata/citus/issues/6496.

DESCRIPTION: Allows using Citus size functions on distributed tables
indexes.

---------

Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-01 09:05:51 +00:00
Jelte Fennema-Nio a76a832553
Fix flaky validate_constraint test (#7293)
Sometimes validate constraint would fail like this:

```diff
  validatable_constraint_8000016 | t
 (10 rows)

 DROP TABLE constrained_table;
+ERROR:  deadlock detected
+DETAIL:  Process 16602 waits for ShareRowExclusiveLock on relation 56258 of database 16384; blocked by process 16601.
+Process 16601 waits for AccessShareLock on relation 56120 of database 16384; blocked by process 16602.
+HINT:  See server log for query details.
 DROP TABLE referenced_table CASCADE;
 DROP TABLE referencing_table;
 DROP SCHEMA validate_constraint CASCADE;
-NOTICE:  drop cascades to 3 other objects
+NOTICE:  drop cascades to 4 other objects
 DETAIL:  drop cascades to type constraint_validity
 drop cascades to view constraint_validations_in_workers
 drop cascades to view constraint_validations
+drop cascades to table constrained_table
 SET search_path TO DEFAULT;

```

Source:
https://github.com/citusdata/citus/actions/runs/6708383699?pr=7291

This change fixes that by not running together with the
foreign_key_to_reference_table test anymore. In passing it also
simplifies dropping of the test its resources.
2023-11-01 09:41:28 +01:00
Jelte Fennema-Nio 81aa660b31
Fix flaky test detection (#7291)
PR #7289 broke flaky test detction. This fixes that.
2023-10-31 15:59:16 +00:00
Jelte Fennema-Nio c72f5357e1 Fix PG16 assertion 2023-10-31 16:10:03 +01:00
Gokhan Gulbiz ce58c04304
Disable CircleCI (#7276)
We are switching to Github Actions. In the test period it has worked well enough, so now we can stop using CircleCI.
2023-10-31 16:00:10 +01:00
Jelte Fennema-Nio 83e3fb817d
Only put major Postgres version in CI task name (#7289)
Making tasks in CI required before merging to master is important and
useful. The way this works is by saving the exact names of the required
tasks in the admin interface of the repo. It has a search box to add
them so it's not completely horrible, but doing so is quite a hassle
since we have so many jobs. So limiting the amount of churn in this list
of required jobs is quite useful.

This changes the names of tasks to only include the major versions of
Postgres, not the minor ones. Otherwise the next time we bump the minor
versions we would have to remove and re-add each of the jobs.
2023-10-31 14:05:09 +01:00
gindibay 2d9181a9ab Fixes indents 2023-10-31 11:00:40 +03:00
gindibay d8639d58de Adds locale restrictions 2023-10-31 10:58:44 +03:00
Gürkan İndibay d99737e8b2
Merge branch 'main' into create_alter_database 2023-10-30 21:09:59 +03:00
Emel Şimşek ee8f4bb7e8
Start Maintenance Daemon for Main DB at the server start. (#7254)
DESCRIPTION: This change starts a maintenance deamon at the time of
server start if there is a designated main database.

This is the code flow:

1. User designates a main database:
   `ALTER SYSTEM SET citus.main_db =  "myadmindb";`

2. When postmaster starts, in _PG_Init, citus calls 
    `InitializeMaintenanceDaemonForMainDb`
  
This function registers a background worker to run
`CitusMaintenanceDaemonMain `with `databaseOid = 0 `

3. `CitusMaintenanceDaemonMain ` takes some special actions when
databaseOid is 0:
     - Gets the citus.main_db  value.
     - Connects to the  citus.main_db
     - Now the `MyDatabaseId `is available, creates a hash entry for it.
     - Then follows the same control flow as for a regular db,
2023-10-30 09:44:13 +03:00
gindibay 693eeedfaf Fixes pg15 test name 2023-10-27 19:08:09 +03:00
gindibay fe136886aa Changes pg15 test files 2023-10-27 18:43:51 +03:00
gindibay 89e2d63bd3 Adds pg15 create drop to minimal tests 2023-10-27 18:37:22 +03:00
gindibay dcae4c3486 Fixes python code format 2023-10-27 18:17:58 +03:00
gindibay 5381aa8fda Fixes flaky tests 2023-10-27 18:13:17 +03:00
gindibay cf7efca546 Fixes single_node for pg14 2023-10-27 18:01:07 +03:00
Nils Dijk d0b093c975
automatically add a breakpoint that breaks on postgres errors (#7279)
When debugging postgres it is quite hard to get to the source for
`errfinish` in `elog.c`. Instead of relying on the developer to set a
breakpoint in the `elog.c` file for `errfinish` for `elevel == ERROR`,
this change adds the breakpoint to `.gdbinit`. This makes sure that
whenever a debugger is attached to a postgres backend it will break on
postgres errors.

When attaching the debugger a small banner is printed that explains how
to disable the breakpoint.
2023-10-27 16:57:51 +02:00
Benjamin O f9218d9780
Support replacing IPv6 Loopback in `normalize.sed` (#7269)
I had a test failure issue due to my machine using the IPv6 loopback
address. This change to the `normalize.sed` solves that issue.
2023-10-27 16:42:55 +02:00
gindibay 2b3a556f34 Fixes pg14 tests 2023-10-27 17:40:37 +03:00
gindibay 8c29444bbf Fixes pg14 tests 2023-10-27 17:25:56 +03:00
gindibay 6eeeddd549 Fixes pg14 tests 2023-10-27 17:11:01 +03:00
gindibay 8519e7d7fa Adds a dummy file for pg14 2023-10-27 16:56:25 +03:00
gindibay a0da426a78 Fixes tests 2023-10-27 16:51:31 +03:00
gindibay 736894472e Fixes pg15 tests 2023-10-27 16:02:09 +03:00
gindibay d323ab8c51 Fixes pg15 sql 2023-10-27 15:44:22 +03:00
gindibay 93dab80206 Moves pg15 tests 2023-10-27 15:33:55 +03:00
gindibay 66b433310c Moves pg15 tests to fix errors 2023-10-27 14:46:41 +03:00
gindibay b4dec6eee8 Fixes test 2023-10-27 14:15:43 +03:00
gindibay 3cb5cab8cd Fixes test problem 2023-10-27 14:01:23 +03:00
gindibay b28210c04f Adds shard selects to debug 2023-10-27 11:03:05 +03:00
gindibay b41feadd97 Fixes indent 2023-10-27 10:39:16 +03:00
gindibay 8811d910a5 Fixes pg 14 compile errors 2023-10-27 10:28:09 +03:00
gindibay 2a6c40d643 Fixes flaky tests 2023-10-27 10:10:42 +03:00
gindibay fe26aebf6c Fixes useless declarations 2023-10-27 09:52:58 +03:00
gindibay 569f4db60c Fixes pg 14 compile warnings 2023-10-27 09:51:15 +03:00
gindibay 72874a8623 Merge remote-tracking branch 'origin/main' into create_alter_database 2023-10-27 09:12:21 +03:00
gindibay a797584f1c Fixes tests 2023-10-27 09:07:19 +03:00
gindibay 473f6cbf05 Fixes metadata sync 2023-10-27 08:37:46 +03:00
gindibay 641e413676 Adds metadatasync for create database 2023-10-26 20:36:43 +03:00
Gokhan Gulbiz 2bf1472c8e
Move GHA environment variables to workflow file (#7275)
Since GHA does not interpolate env variables in a matrix context, This
PR defines them in a separate job and uses them in other jobs.
2023-10-26 14:54:58 +03:00
gindibay c8fcf080c2 Fixes out files for transaction message 2023-10-24 20:44:43 +03:00
gindibay c437850db5 Beatufies error message 2023-10-24 19:25:26 +03:00
gindibay 48d749e2e8 Fixes message for non-transaction-safe commands 2023-10-24 19:15:46 +03:00