|
342 | 342 | ), |
343 | 343 | "the xmin value of slot 'pg_conflict_detection' is updated on Node A"); |
344 | 344 |
|
345 | | -# Confirm that the dead tuple can be removed now |
346 | | -($cmdret, $stdout, $stderr) = $node_A->psql( |
347 | | - 'postgres', qq(VACUUM (verbose) public.tab;) |
348 | | -); |
349 | | - |
350 | | -ok( $stderr =~ |
351 | | - qr/1 removed, 1 remain, 0 are dead but not yet removable/, |
352 | | - 'the deleted column is removed'); |
353 | | - |
354 | 345 | ############################################################################### |
355 | 346 | # Ensure that the deleted tuple needed to detect an update_deleted conflict is |
356 | 347 | # accessible via a sequential table scan. |
|
555 | 546 | "the xmin value of slot 'pg_conflict_detection' is updated on subscriber" |
556 | 547 | ); |
557 | 548 |
|
558 | | - # Confirm that the dead tuple can be removed now |
559 | | - ($cmdret, $stdout, $stderr) = |
560 | | - $node_A->psql('postgres', qq(VACUUM (verbose) public.tab;)); |
561 | | - |
562 | | - ok($stderr =~ qr/1 removed, 0 remain, 0 are dead but not yet removable/, |
563 | | - 'the deleted column is removed'); |
564 | | - |
565 | 549 | # Get the commit timestamp for the publisher's update |
566 | 550 | my $pub_ts = $node_B->safe_psql('postgres', |
567 | 551 | "SELECT pg_xact_commit_timestamp(xmin) from tab where a=1;"); |
|
625 | 609 | "SELECT subretentionactive FROM pg_subscription WHERE subname='$subname_AB';"); |
626 | 610 | is($result, qq(f), 'retention is inactive'); |
627 | 611 |
|
628 | | -# Drop the physical slot and reset the synchronized_standby_slots setting |
629 | | -$node_B->safe_psql('postgres', |
630 | | - "SELECT * FROM pg_drop_replication_slot('blocker');"); |
631 | | -$node_B->adjust_conf('postgresql.conf', 'synchronized_standby_slots', "''"); |
632 | | -$node_B->reload; |
633 | | - |
634 | 612 | ############################################################################### |
635 | 613 | # Check that dead tuple retention resumes when the max_retention_duration is set |
636 | 614 | # 0. |
|
642 | 620 | $node_A->safe_psql('postgres', |
643 | 621 | "ALTER SUBSCRIPTION $subname_AB SET (max_retention_duration = 0);"); |
644 | 622 |
|
| 623 | +# Drop the physical slot and reset the synchronized_standby_slots setting. We |
| 624 | +# change this after setting max_retention_duration to 0, ensuring the apply |
| 625 | +# worker does not resume prematurely without noticing the updated |
| 626 | +# max_retention_duration value. |
| 627 | +$node_B->safe_psql('postgres', |
| 628 | + "SELECT * FROM pg_drop_replication_slot('blocker');"); |
| 629 | +$node_B->adjust_conf('postgresql.conf', 'synchronized_standby_slots', "''"); |
| 630 | +$node_B->reload; |
| 631 | + |
645 | 632 | # Confirm that the retention resumes |
646 | 633 | $node_A->wait_for_log( |
647 | 634 | qr/logical replication worker for subscription "tap_sub_a_b" will resume retaining the information for detecting conflicts |
|
0 commit comments