summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-10-08 15:43:27 +0300
committerunknown <monty@mysql.com>2004-10-08 15:43:27 +0300
commitb5f445a0e9f35809d49faee64b69f45c12e8d877 (patch)
tree26d8a4d43267899111e3c944feb5b5c4064aaf54
parent57fedc40708ed3266d79347cd71e829297352409 (diff)
parent66bdcf8439c3397856d028b13a6f0bb09769434d (diff)
downloadmariadb-git-b5f445a0e9f35809d49faee64b69f45c12e8d877.tar.gz
Merge
BitKeeper/etc/logging_ok: auto-union innobase/include/sync0arr.h: Auto merged innobase/sync/sync0arr.c: Auto merged scripts/mysqlhotcopy.sh: Auto merged innobase/srv/srv0srv.c: SCCS merged
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--innobase/include/sync0arr.h4
-rw-r--r--innobase/srv/srv0srv.c20
-rw-r--r--innobase/sync/sync0arr.c15
-rw-r--r--scripts/mysqlhotcopy.sh8
5 files changed, 31 insertions, 17 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index ac45466be22..a647da7b302 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -67,6 +67,7 @@ igor@rurik.mysql.com
ingo@mysql.com
jan@hundin.mysql.fi
jani@a80-186-24-72.elisa-laajakaista.fi
+jani@a80-186-41-201.elisa-laajakaista.fi
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-kpogw4gb5.dial.inet.fi
jani@hynda.(none)
diff --git a/innobase/include/sync0arr.h b/innobase/include/sync0arr.h
index 92691d5fdd9..fecd910683e 100644
--- a/innobase/include/sync0arr.h
+++ b/innobase/include/sync0arr.h
@@ -97,9 +97,11 @@ sync_arr_wake_threads_if_sema_free(void);
/**************************************************************************
Prints warnings of long semaphore waits to stderr. */
-void
+ibool
sync_array_print_long_waits(void);
/*=============================*/
+ /* out: TRUE if fatal semaphore wait threshold
+ was exceeded */
/************************************************************************
Validates the integrity of the wait array. Checks
that the number of reserved cells equals the count variable. */
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index adffe06ef0a..94930b24e78 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1810,7 +1810,8 @@ srv_error_monitor_thread(
/* in: a dummy parameter required by
os_thread_create */
{
- ulint cnt = 0;
+ /* number of successive fatal timeouts observed */
+ ulint fatal_cnt = 0;
dulint old_lsn;
dulint new_lsn;
@@ -1823,8 +1824,6 @@ srv_error_monitor_thread(
loop:
srv_error_monitor_active = TRUE;
- cnt++;
-
/* Try to track a strange bug reported by Harald Fuchs and others,
where the lsn seems to decrease at times */
@@ -1851,7 +1850,20 @@ loop:
srv_refresh_innodb_monitor_stats();
}
- sync_array_print_long_waits();
+ if (sync_array_print_long_waits()) {
+ fatal_cnt++;
+ if (fatal_cnt > 5) {
+
+ fprintf(stderr,
+"InnoDB: Error: semaphore wait has lasted > %lu seconds\n"
+"InnoDB: We intentionally crash the server, because it appears to be hung.\n",
+ srv_fatal_semaphore_wait_threshold);
+
+ ut_error;
+ }
+ } else {
+ fatal_cnt = 0;
+ }
/* Flush stderr so that a database user gets the output
to possible MySQL error file */
diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
index e5285cb7ebf..198ef49ca9f 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -894,15 +894,18 @@ sync_arr_wake_threads_if_sema_free(void)
/**************************************************************************
Prints warnings of long semaphore waits to stderr. */
-void
+ibool
sync_array_print_long_waits(void)
/*=============================*/
+ /* out: TRUE if fatal semaphore wait threshold
+ was exceeded */
{
sync_cell_t* cell;
ibool old_val;
ibool noticed = FALSE;
ulint i;
ulint fatal_timeout = srv_fatal_semaphore_wait_threshold;
+ ibool fatal = FALSE;
for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
@@ -919,13 +922,7 @@ sync_array_print_long_waits(void)
if (cell->wait_object != NULL
&& difftime(time(NULL), cell->reservation_time)
> fatal_timeout) {
-
- fprintf(stderr,
-"InnoDB: Error: semaphore wait has lasted > %lu seconds\n"
-"InnoDB: We intentionally crash the server, because it appears to be hung.\n",
- fatal_timeout);
-
- ut_error;
+ fatal = TRUE;
}
}
@@ -953,6 +950,8 @@ sync_array_print_long_waits(void)
fprintf(stderr,
"InnoDB: ###### Diagnostic info printed to the standard error stream\n");
}
+
+ return(fatal);
}
/**************************************************************************
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index b8494727975..2cfe91da115 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -8,7 +8,7 @@ use File::Path;
use DBI;
use Sys::Hostname;
use File::Copy;
-use File::Temp;
+use File::Temp qw(tempfile);
=head1 NAME
@@ -39,7 +39,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file
-my $VERSION = "1.21";
+my $VERSION = "1.22";
my $opt_tmpdir = $ENV{TMPDIR} || "/tmp";
@@ -655,8 +655,8 @@ sub copy_index
}
elsif ($opt{method} =~ /^scp\b/)
{
- my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir);
- die "Can\'t create/open file in $opt_tmpdir\n";
+ my ($fh, $tmp)= tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir) or
+ die "Can\'t create/open file in $opt_tmpdir\n";
if (syswrite($fh,$buff) != length($buff))
{
die "Error when writing data to $tmp: $!\n";