diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index 5f3e1d1faf930..da40bd6a64755 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -602,6 +602,7 @@ AC_CACHE_CHECK([for _mm512_clmulepi64_epi128], [Ac_cachevar], { __m128i z; + x = _mm512_xor_si512(_mm512_zextsi128_si512(_mm_cvtsi32_si128(0)), x); y = _mm512_clmulepi64_epi128(x, y, 0); z = _mm_ternarylogic_epi64( _mm512_castsi512_si128(y), diff --git a/configure b/configure index 4f15347cc9503..3d3d3db97a456 100755 --- a/configure +++ b/configure @@ -18227,6 +18227,7 @@ else { __m128i z; + x = _mm512_xor_si512(_mm512_zextsi128_si512(_mm_cvtsi32_si128(0)), x); y = _mm512_clmulepi64_epi128(x, y, 0); z = _mm_ternarylogic_epi64( _mm512_castsi512_si128(y), diff --git a/meson.build b/meson.build index d142e3e408b38..6ffe7b4727556 100644 --- a/meson.build +++ b/meson.build @@ -1205,7 +1205,7 @@ if not perlopt.disabled() if cc.get_id() == 'msvc' # prevent binary mismatch between MSVC built plperl and Strawberry or # msys ucrt perl libraries - perl_v = run_command(perl, '-V').stdout() + perl_v = run_command(perl, '-V', check: false).stdout() if not perl_v.contains('USE_THREAD_SAFE_LOCALE') perl_ccflags += ['-DNO_THREAD_SAFE_LOCALE'] endif @@ -2465,6 +2465,7 @@ int main(void) { __m128i z; + x = _mm512_xor_si512(_mm512_zextsi128_si512(_mm_cvtsi32_si128(0)), x); y = _mm512_clmulepi64_epi128(x, y, 0); z = _mm_ternarylogic_epi64( _mm512_castsi512_si128(y), diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index c64f020742f8f..c11e588d63221 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -1810,8 +1810,6 @@ InvalidatePossiblyObsoleteSlot(uint32 possible_causes, */ SpinLockAcquire(&s->mutex); - Assert(s->data.restart_lsn >= s->last_saved_restart_lsn); - restart_lsn = s->data.restart_lsn; /* we do nothing if the slot is already invalid */ diff --git a/src/port/pg_crc32c_sse42.c b/src/port/pg_crc32c_sse42.c index 9af3474a6ca95..1a7172553551a 100644 --- a/src/port/pg_crc32c_sse42.c +++ b/src/port/pg_crc32c_sse42.c @@ -123,7 +123,7 @@ pg_comp_crc32c_avx512(pg_crc32c crc, const void *data, size_t len) __m512i k; k = _mm512_broadcast_i32x4(_mm_setr_epi32(0x740eef02, 0, 0x9e4addf8, 0)); - x0 = _mm512_xor_si512(_mm512_castsi128_si512(_mm_cvtsi32_si128(crc0)), x0); + x0 = _mm512_xor_si512(_mm512_zextsi128_si512(_mm_cvtsi32_si128(crc0)), x0); buf += 64; /* Main loop. */ diff --git a/src/port/pg_crc32c_sse42_choose.c b/src/port/pg_crc32c_sse42_choose.c index 802e47788c10c..74d2421ba2be9 100644 --- a/src/port/pg_crc32c_sse42_choose.c +++ b/src/port/pg_crc32c_sse42_choose.c @@ -95,9 +95,7 @@ pg_comp_crc32c_choose(pg_crc32c crc, const void *data, size_t len) __cpuidex(exx, 7, 0); #endif -#if defined(__clang__) && !defined(__OPTIMIZE__) - /* Some versions of clang are broken at -O0 */ -#elif defined(USE_AVX512_CRC32C_WITH_RUNTIME_CHECK) +#ifdef USE_AVX512_CRC32C_WITH_RUNTIME_CHECK if (exx[2] & (1 << 10) && /* VPCLMULQDQ */ exx[1] & (1 << 31)) /* AVX512-VL */ pg_comp_crc32c = pg_comp_crc32c_avx512; diff --git a/src/test/recovery/meson.build b/src/test/recovery/meson.build index 92429d2840257..28fd9ae8dda0d 100644 --- a/src/test/recovery/meson.build +++ b/src/test/recovery/meson.build @@ -54,7 +54,6 @@ tests += { 't/043_no_contrecord_switch.pl', 't/044_invalidate_inactive_slots.pl', 't/045_archive_restartpoint.pl', - 't/046_checkpoint_logical_slot.pl', 't/047_checkpoint_physical_slot.pl' ], }, diff --git a/src/test/recovery/t/046_checkpoint_logical_slot.pl b/src/test/recovery/t/046_checkpoint_logical_slot.pl deleted file mode 100644 index d67c5108d7800..0000000000000 --- a/src/test/recovery/t/046_checkpoint_logical_slot.pl +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2025, PostgreSQL Global Development Group -# -# This test verifies the case when the logical slot is advanced during -# checkpoint. The test checks that the logical slot's restart_lsn still refers -# to an existed WAL segment after immediate restart. -# -use strict; -use warnings FATAL => 'all'; - -use PostgreSQL::Test::Cluster; -use PostgreSQL::Test::Utils; - -use Test::More; - -if ($ENV{enable_injection_points} ne 'yes') -{ - plan skip_all => 'Injection points not supported by this build'; -} - -my ($node, $result); - -$node = PostgreSQL::Test::Cluster->new('mike'); -$node->init; -$node->append_conf('postgresql.conf', "wal_level = 'logical'"); -$node->start; - -# Check if the extension injection_points is available, as it may be -# possible that this script is run with installcheck, where the module -# would not be installed by default. -if (!$node->check_extension('injection_points')) -{ - plan skip_all => 'Extension injection_points not installed'; -} - -$node->safe_psql('postgres', q(CREATE EXTENSION injection_points)); - -# Create the two slots we'll need. -$node->safe_psql('postgres', - q{select pg_create_logical_replication_slot('slot_logical', 'test_decoding')} -); -$node->safe_psql('postgres', - q{select pg_create_physical_replication_slot('slot_physical', true)}); - -# Advance both slots to the current position just to have everything "valid". -$node->safe_psql('postgres', - q{select count(*) from pg_logical_slot_get_changes('slot_logical', null, null)} -); -$node->safe_psql('postgres', - q{select pg_replication_slot_advance('slot_physical', pg_current_wal_lsn())} -); - -# Run checkpoint to flush current state to disk and set a baseline. -$node->safe_psql('postgres', q{checkpoint}); - -# Generate some transactions to get RUNNING_XACTS. -my $xacts = $node->background_psql('postgres'); -$xacts->query_until( - qr/run_xacts/, - q(\echo run_xacts -SELECT 1 \watch 0.1 -\q -)); - -$node->advance_wal(20); - -# Run another checkpoint to set a new restore LSN. -$node->safe_psql('postgres', q{checkpoint}); - -$node->advance_wal(20); - -# Run another checkpoint, this time in the background, and make it wait -# on the injection point) so that the checkpoint stops right before -# removing old WAL segments. -note('starting checkpoint'); - -my $checkpoint = $node->background_psql('postgres'); -$checkpoint->query_safe( - q(select injection_points_attach('checkpoint-before-old-wal-removal','wait')) -); -$checkpoint->query_until( - qr/starting_checkpoint/, - q(\echo starting_checkpoint -checkpoint; -\q -)); - -# Wait until the checkpoint stops right before removing WAL segments. -note('waiting for injection_point'); -$node->wait_for_event('checkpointer', 'checkpoint-before-old-wal-removal'); -note('injection_point is reached'); - -# Try to advance the logical slot, but make it stop when it moves to the next -# WAL segment (this has to happen in the background, too). -my $logical = $node->background_psql('postgres'); -$logical->query_safe( - q{select injection_points_attach('logical-replication-slot-advance-segment','wait');} -); -$logical->query_until( - qr/get_changes/, - q( -\echo get_changes -select count(*) from pg_logical_slot_get_changes('slot_logical', null, null) \watch 1 -\q -)); - -# Wait until the slot's restart_lsn points to the next WAL segment. -note('waiting for injection_point'); -$node->wait_for_event('client backend', - 'logical-replication-slot-advance-segment'); -note('injection_point is reached'); - -# OK, we're in the right situation: time to advance the physical slot, which -# recalculates the required LSN, and then unblock the checkpoint, which -# removes the WAL still needed by the logical slot. -$node->safe_psql('postgres', - q{select pg_replication_slot_advance('slot_physical', pg_current_wal_lsn())} -); - -# Continue the checkpoint. -$node->safe_psql('postgres', - q{select injection_points_wakeup('checkpoint-before-old-wal-removal')}); - -# Abruptly stop the server (1 second should be enough for the checkpoint -# to finish; it would be better). -$node->stop('immediate'); - -$node->start; - -eval { - $node->safe_psql('postgres', - q{select count(*) from pg_logical_slot_get_changes('slot_logical', null, null);} - ); -}; -is($@, '', "Logical slot still valid"); - -done_testing(); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy