Skip to content

Commit b690d1c

Browse files
committed
Merge remote-tracking branch 'origin/release-13.0' into naisila/drop_pg14
2 parents 1cca860 + 26f16a7 commit b690d1c

File tree

12 files changed

+84
-18
lines changed

12 files changed

+84
-18
lines changed

.github/actions/save_logs_and_results/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
runs:
77
using: composite
88
steps:
9-
- uses: actions/upload-artifact@v3.1.1
9+
- uses: actions/upload-artifact@v4.6.0
1010
name: Upload logs
1111
with:
1212
name: ${{ inputs.folder }}

.github/actions/setup_extension/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
echo "PG_MAJOR=${{ inputs.pg_major }}" >> $GITHUB_ENV
1818
fi
1919
shell: bash
20-
- uses: actions/download-artifact@v3.0.1
20+
- uses: actions/download-artifact@v4.1.8
2121
with:
2222
name: build-${{ env.PG_MAJOR }}
2323
- name: Install Extension

.github/actions/upload_coverage/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ runs:
2121
mkdir -p /tmp/codeclimate
2222
cc-test-reporter format-coverage -t lcov -o /tmp/codeclimate/${{ inputs.flags }}.json lcov.info
2323
shell: bash
24-
- uses: actions/upload-artifact@v3.1.1
24+
- uses: actions/upload-artifact@v4.6.0
2525
with:
2626
path: "/tmp/codeclimate/*.json"
27-
name: codeclimate
27+
name: codeclimate-${{ inputs.flags }}

.github/workflows/build_and_test.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- name: Build
122122
run: "./ci/build-citus.sh"
123123
shell: bash
124-
- uses: actions/upload-artifact@v3.1.1
124+
- uses: actions/upload-artifact@v4.6.0
125125
with:
126126
name: build-${{ env.PG_MAJOR }}
127127
path: |-
@@ -284,10 +284,12 @@ jobs:
284284
check-arbitrary-configs parallel=4 CONFIGS=$TESTS
285285
- uses: "./.github/actions/save_logs_and_results"
286286
if: always()
287+
with:
288+
folder: ${{ env.PG_MAJOR }}_arbitrary_configs_${{ matrix.parallel }}
287289
- uses: "./.github/actions/upload_coverage"
288290
if: always()
289291
with:
290-
flags: ${{ env.pg_major }}_upgrade
292+
flags: ${{ env.PG_MAJOR }}_arbitrary_configs_${{ matrix.parallel }}
291293
codecov_token: ${{ secrets.CODECOV_TOKEN }}
292294
test-pg-upgrade:
293295
name: PG${{ matrix.old_pg_major }}-PG${{ matrix.new_pg_major }} - check-pg-upgrade
@@ -335,6 +337,8 @@ jobs:
335337
if: failure()
336338
- uses: "./.github/actions/save_logs_and_results"
337339
if: always()
340+
with:
341+
folder: ${{ env.old_pg_major }}_${{ env.new_pg_major }}_upgrade
338342
- uses: "./.github/actions/upload_coverage"
339343
if: always()
340344
with:
@@ -380,10 +384,12 @@ jobs:
380384
done;
381385
- uses: "./.github/actions/save_logs_and_results"
382386
if: always()
387+
with:
388+
folder: ${{ env.PG_MAJOR }}_citus_upgrade
383389
- uses: "./.github/actions/upload_coverage"
384390
if: always()
385391
with:
386-
flags: ${{ env.pg_major }}_upgrade
392+
flags: ${{ env.PG_MAJOR }}_citus_upgrade
387393
codecov_token: ${{ secrets.CODECOV_TOKEN }}
388394
upload-coverage:
389395
if: always()
@@ -399,10 +405,11 @@ jobs:
399405
- test-citus-upgrade
400406
- test-pg-upgrade
401407
steps:
402-
- uses: actions/download-artifact@v3.0.1
408+
- uses: actions/download-artifact@v4.1.8
403409
with:
404-
name: "codeclimate"
405-
path: "codeclimate"
410+
pattern: codeclimate*
411+
path: codeclimate
412+
merge-multiple: true
406413
- name: Upload coverage results to Code Climate
407414
run: |-
408415
cc-test-reporter sum-coverage codeclimate/*.json -o total.json
@@ -500,7 +507,7 @@ jobs:
500507
matrix: ${{ fromJson(needs.prepare_parallelization_matrix_32.outputs.json) }}
501508
steps:
502509
- uses: actions/[email protected]
503-
- uses: actions/download-artifact@v3.0.1
510+
- uses: actions/download-artifact@v4.1.8
504511
- uses: "./.github/actions/setup_extension"
505512
- name: Run minimal tests
506513
run: |-

.github/workflows/flaky_test_debugging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
echo "PG_MAJOR=${PG_MAJOR}" >> $GITHUB_ENV
3535
./ci/build-citus.sh
3636
shell: bash
37-
- uses: actions/upload-artifact@v3.1.1
37+
- uses: actions/upload-artifact@v4.6.0
3838
with:
3939
name: build-${{ env.PG_MAJOR }}
4040
path: |-

src/backend/distributed/transaction/transaction_recovery.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,23 @@ RecoverWorkerTransactions(WorkerNode *workerNode)
347347
}
348348

349349
systable_endscan(scanDescriptor);
350-
table_close(pgDistTransaction, NoLock);
350+
351+
/*
352+
* Here we release the lock on pg_dist_transaction while closing it to avoid
353+
* deadlocks that might occur because of trying to acquire a lock on
354+
* pg_dist_authinfo while holding a lock on pg_dist_transaction. Such a scenario
355+
* can only cause a deadlock if another transaction is trying to acquire a strong
356+
* lock on pg_dist_transaction while holding a lock on pg_dist_authinfo. As of
357+
* today, we (implicitly) acquire a strong lock on pg_dist_transaction only when
358+
* upgrading Citus to 11.3-1 and this happens when creating a REPLICA IDENTITY on
359+
* pg_dist_transaction.
360+
*
361+
* And reglardless of the code-path we are in, it should be okay to release the
362+
* lock now because all we do after this point is to abort the prepared
363+
* transactions that are not part of an in-progress distributed transaction and
364+
* releasing the lock before doing so should be just fine.
365+
*/
366+
table_close(pgDistTransaction, RowExclusiveLock);
351367

352368
if (!recoveryFailed)
353369
{

src/test/regress/expected/isolation_create_restore_point.out

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,15 @@ recover_prepared_transactions
147147

148148
step s2-create-restore:
149149
SELECT 1 FROM citus_create_restore_point('citus-test');
150-
<waiting ...>
151-
step s1-commit:
152-
COMMIT;
153150

154-
step s2-create-restore: <... completed>
155151
?column?
156152
---------------------------------------------------------------------
157153
1
158154
(1 row)
159155

156+
step s1-commit:
157+
COMMIT;
158+
160159

161160
starting permutation: s1-begin s1-drop s2-create-restore s1-commit
162161
create_reference_table

src/test/regress/expected/upgrade_pg_dist_cleanup_after_0.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ SELECT * FROM pg_dist_cleanup;
2828
CALL citus_cleanup_orphaned_resources();
2929
NOTICE: cleaned up 1 orphaned resources
3030
DROP TABLE table_with_orphaned_shards;
31+
-- Re-enable automatic shard cleanup by maintenance daemon as
32+
-- we have disabled it in upgrade_pg_dist_cleanup_before.sql
33+
ALTER SYSTEM RESET citus.defer_shard_delete_interval;
34+
SELECT pg_reload_conf();
35+
pg_reload_conf
36+
---------------------------------------------------------------------
37+
t
38+
(1 row)
39+

src/test/regress/expected/upgrade_pg_dist_cleanup_before_0.out

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ SELECT COUNT(*) FROM pg_dist_placement WHERE shardstate = 1 AND shardid IN (SELE
3030
(1 row)
3131

3232
-- create an orphaned placement based on an existing one
33+
--
34+
-- But before doing that, first disable automatic shard cleanup
35+
-- by maintenance daemon so that we can reliably test the cleanup
36+
-- in upgrade_pg_dist_cleanup_after.sql.
37+
ALTER SYSTEM SET citus.defer_shard_delete_interval TO -1;
38+
SELECT pg_reload_conf();
39+
pg_reload_conf
40+
---------------------------------------------------------------------
41+
t
42+
(1 row)
43+
44+
SELECT pg_sleep(0.1);
45+
pg_sleep
46+
---------------------------------------------------------------------
47+
48+
(1 row)
49+
3350
INSERT INTO pg_dist_placement(placementid, shardid, shardstate, shardlength, groupid)
3451
SELECT nextval('pg_dist_placement_placementid_seq'::regclass), shardid, 4, shardlength, 3-groupid
3552
FROM pg_dist_placement

src/test/regress/spec/isolation_create_restore_point.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ permutation "s1-begin" "s1-ddl" "s2-create-restore" "s1-commit"
154154
// verify that citus_create_restore_point is not blocked by concurrent COPY (only commit)
155155
permutation "s1-begin" "s1-copy" "s2-create-restore" "s1-commit"
156156

157-
// verify that citus_create_restore_point is blocked by concurrent recover_prepared_transactions
157+
// verify that citus_create_restore_point is partially blocked by concurrent recover_prepared_transactions.
158+
// In the test output, we won't be able to explicitly observe this since
159+
// recover_prepared_transactions unblocks citus_create_restore_point after in-progress prepared transactions
160+
// are recovered.
158161
permutation "s1-begin" "s1-recover" "s2-create-restore" "s1-commit"
159162

160163
// verify that citus_create_restore_point is blocked by concurrent DROP TABLE

0 commit comments

Comments
 (0)