agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH v2 1/2] Add a new test to detect a replication bug 3+ messages / 2 participants [nested] [flat]
* [PATCH v2 1/2] Add a new test to detect a replication bug @ 2020-12-09 08:21 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Kyotaro Horiguchi @ 2020-12-09 08:21 UTC (permalink / raw) --- src/test/recovery/t/001_stream_rep.pl | 65 ++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl index 9e31a53de7..13b6e00da4 100644 --- a/src/test/recovery/t/001_stream_rep.pl +++ b/src/test/recovery/t/001_stream_rep.pl @@ -2,8 +2,9 @@ use strict; use warnings; use PostgresNode; +use Time::HiRes qw(usleep); use TestLib; -use Test::More tests => 36; +use Test::More tests => 37; # Initialize primary node my $node_primary = get_new_node('primary'); @@ -409,3 +410,65 @@ ok( ($phys_restart_lsn_pre cmp $phys_restart_lsn_post) == 0, my $primary_data = $node_primary->data_dir; ok(!-f "$primary_data/pg_wal/$segment_removed", "WAL segment $segment_removed recycled after physical slot advancing"); + +# +# Check if timeline-increment works while reading a historic timeline. +my $node_primary_2 = get_new_node('primary_2'); +$node_primary_2->init(allows_streaming => 1); +$node_primary_2->enable_archiving; # needed to make .paritial segment +$node_primary_2->start; +$node_primary_2->backup($backup_name); +my $node_standby_3 = get_new_node('standby_3'); +$node_standby_3->init_from_backup($node_primary_2, $backup_name, + has_streaming => 1); +$node_primary_2->stop; +$node_primary_2->set_standby_mode; # increment primary timeline +$node_primary_2->start; +$node_primary_2->promote; +my $logstart = get_log_size($node_standby_3); +$node_standby_3->start; + +my $success = 0; +for (my $i = 0 ; $i < 1000; $i++) +{ + if (find_in_log( + $node_standby_3, + "requested WAL segment [0-9A-F]+ has already been removed", + $logstart)) + { + last; + } + elsif (find_in_log( + $node_standby_3, + "End of WAL reached on timeline", + $logstart)) + { + $success = 1; + last; + } + usleep(100_000); +} + +ok($success, 'Timeline increment while reading a historic timeline'); + +# return the size of logfile of $node in bytes +sub get_log_size +{ + my ($node) = @_; + + return (stat $node->logfile)[7]; +} + +# find $pat in logfile of $node after $off-th byte +sub find_in_log +{ + my ($node, $pat, $off) = @_; + + $off = 0 unless defined $off; + my $log = TestLib::slurp_file($node->logfile); + return 0 if (length($log) <= $off); + + $log = substr($log, $off); + + return $log =~ m/$pat/; +} -- 2.27.0 ----Next_Part(Mon_Jan__4_12_06_10_2021_267)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v2-0002-Fix-a-bug-of-timeline-tracking-while-sending-a-hi.patch" ^ permalink raw reply [nested|flat] 3+ messages in thread
* [PATCH] Improve configure error for ICU libraries if pkg-config is absent. @ 2024-08-09 08:13 Michael Banck <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Michael Banck @ 2024-08-09 08:13 UTC (permalink / raw) If pkg-config is not installed, the ICU libraries cannot be found, but this was not mentioned in the error message and might lead to confusion about the actual problem. To improve this, add an additional error message for the case that pkg-config is not available. Reported-by: Holger Jakobs Discussion: https://www.postgresql.org/message-id/ccd579ed-4949-d3de-ab13-9e6456fd2caf%40jakobs.com --- configure | 7 +++++++ configure.ac | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/configure b/configure index 4f3aa44756..b3a2774f1b 100755 --- a/configure +++ b/configure @@ -8094,6 +8094,13 @@ $as_echo "$with_icu" >&6; } if test "$with_icu" = yes; then + if test -z "$PKG_CONFIG"; then + as_fn_error $? "ICU library not found +The ICU library could not be found because pkg-config is not available, see +config.log for details on the failure. If ICU is installed, the variables +ICU_CFLAGS and ICU_LIBS can be set explicitly in this case, or use +--without-icu to disable ICU support." "$LINENO" 5 + fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu-uc icu-i18n" >&5 diff --git a/configure.ac b/configure.ac index 049bc01491..18472a464a 100644 --- a/configure.ac +++ b/configure.ac @@ -829,6 +829,13 @@ AC_MSG_RESULT([$with_icu]) AC_SUBST(with_icu) if test "$with_icu" = yes; then + if test -z "$PKG_CONFIG"; then + AC_MSG_ERROR([ICU library not found +The ICU library could not be found because pkg-config is not available, see +config.log for details on the failure. If ICU is installed, the variables +ICU_CFLAGS and ICU_LIBS can be set explicitly in this case, or use +--without-icu to disable ICU support.]) + fi PKG_CHECK_MODULES(ICU, icu-uc icu-i18n, [], [AC_MSG_ERROR([ICU library not found If you have ICU already installed, see config.log for details on the -- 2.39.2 --3V7upXqbjpZ4EhLz-- ^ permalink raw reply [nested|flat] 3+ messages in thread
* [PATCH v2] Improve configure error for ICU libraries if pkg-config is absent. @ 2024-08-09 08:13 Michael Banck <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Michael Banck @ 2024-08-09 08:13 UTC (permalink / raw) If pkg-config is not installed, the ICU libraries cannot be found, but the custom configure error message did not mention this. This might lead to confusion about the actual problem. To improve this, remove the explicit error message and rely on PKG_CHECK_MODULES' generic error message. Reported-by: Holger Jakobs Discussion: https://www.postgresql.org/message-id/ccd579ed-4949-d3de-ab13-9e6456fd2caf%40jakobs.com --- configure | 30 ++++++++++++++++++++++-------- configure.ac | 6 +----- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 4f3aa44756..14b7ae27e6 100755 --- a/configure +++ b/configure @@ -8153,17 +8153,31 @@ fi # Put the nasty error message in config.log where it belongs echo "$ICU_PKG_ERRORS" >&5 - as_fn_error $? "ICU library not found -If you have ICU already installed, see config.log for details on the -failure. It is possible the compiler isn't looking in the proper directory. -Use --without-icu to disable ICU support." "$LINENO" 5 + as_fn_error $? "Package requirements (icu-uc icu-i18n) were not met: + +$ICU_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables ICU_CFLAGS +and ICU_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error $? "ICU library not found -If you have ICU already installed, see config.log for details on the -failure. It is possible the compiler isn't looking in the proper directory. -Use --without-icu to disable ICU support." "$LINENO" 5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables ICU_CFLAGS +and ICU_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/;. +See \`config.log' for more details" "$LINENO" 5; } else ICU_CFLAGS=$pkg_cv_ICU_CFLAGS ICU_LIBS=$pkg_cv_ICU_LIBS diff --git a/configure.ac b/configure.ac index 049bc01491..94e35da4f2 100644 --- a/configure.ac +++ b/configure.ac @@ -829,11 +829,7 @@ AC_MSG_RESULT([$with_icu]) AC_SUBST(with_icu) if test "$with_icu" = yes; then - PKG_CHECK_MODULES(ICU, icu-uc icu-i18n, [], - [AC_MSG_ERROR([ICU library not found -If you have ICU already installed, see config.log for details on the -failure. It is possible the compiler isn't looking in the proper directory. -Use --without-icu to disable ICU support.])]) + PKG_CHECK_MODULES(ICU, icu-uc icu-i18n) fi # -- 2.39.2 --MW5yreqqjyrRcusr-- ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-08-09 08:13 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-12-09 08:21 [PATCH v2 1/2] Add a new test to detect a replication bug Kyotaro Horiguchi <[email protected]> 2024-08-09 08:13 [PATCH] Improve configure error for ICU libraries if pkg-config is absent. Michael Banck <[email protected]> 2024-08-09 08:13 [PATCH v2] Improve configure error for ICU libraries if pkg-config is absent. Michael Banck <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox