summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-07-24 13:55:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-07-24 21:59:26 +0300
commit2b5bc761d3a2a9b460b4cbb8e8a9ce0d50e63371 (patch)
treef5502a690e9e16e9ebe82a62c28f7dabcf20cc63
parent10727b69530da609c26d61294ec4f6870b62a09a (diff)
downloadmariadb-git-2b5bc761d3a2a9b460b4cbb8e8a9ce0d50e63371.tar.gz
MDEV-14154: Document some time_t fields better
srv_slot_t::suspend_time, os_aio_slot_t::reservation_time, sync_cell_t::reservation_time: Explain what could happen if the system time has is being adjusted. fts_sync_t::start_time: Document that the field is mostly unused.
-rw-r--r--storage/innobase/include/fts0types.h4
-rw-r--r--storage/innobase/sync/sync0arr.cc6
-rw-r--r--storage/xtradb/include/fts0types.h4
-rw-r--r--storage/xtradb/include/srv0srv.h11
-rw-r--r--storage/xtradb/os/os0file.cc5
-rw-r--r--storage/xtradb/sync/sync0arr.cc6
6 files changed, 24 insertions, 12 deletions
diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h
index 0da9fe47955..3cb01a92df0 100644
--- a/storage/innobase/include/fts0types.h
+++ b/storage/innobase/include/fts0types.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -122,7 +123,8 @@ struct fts_sync_t {
doc_id_t max_doc_id; /*!< The doc id at which the cache was
noted as being full, we use this to
set the upper_limit field */
- ib_time_t start_time; /*!< SYNC start time */
+ time_t start_time; /*!< SYNC start time; only used if
+ fts_enable_diag_print */
bool in_progress; /*!< flag whether sync is in progress.*/
bool unlock_cache; /*!< flag whether unlock cache when
write fts node */
diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc
index 8f83f2e0919..91a07a9a4c0 100644
--- a/storage/innobase/sync/sync0arr.cc
+++ b/storage/innobase/sync/sync0arr.cc
@@ -122,8 +122,10 @@ struct sync_cell_t {
has not been signalled in the
period between the reset and
wait call. */
- time_t reservation_time;/*!< time when the thread reserved
- the wait cell */
+ /** time(NULL) when the wait cell was reserved.
+ FIXME: sync_array_print_long_waits_low() may display bogus
+ warnings when the system time is adjusted to the past! */
+ time_t reservation_time;
};
/* NOTE: It is allowed for a thread to wait
diff --git a/storage/xtradb/include/fts0types.h b/storage/xtradb/include/fts0types.h
index 0da9fe47955..3cb01a92df0 100644
--- a/storage/xtradb/include/fts0types.h
+++ b/storage/xtradb/include/fts0types.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -122,7 +123,8 @@ struct fts_sync_t {
doc_id_t max_doc_id; /*!< The doc id at which the cache was
noted as being full, we use this to
set the upper_limit field */
- ib_time_t start_time; /*!< SYNC start time */
+ time_t start_time; /*!< SYNC start time; only used if
+ fts_enable_diag_print */
bool in_progress; /*!< flag whether sync is in progress.*/
bool unlock_cache; /*!< flag whether unlock cache when
write fts node */
diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h
index 9c01bb0148d..e8dd1954797 100644
--- a/storage/xtradb/include/srv0srv.h
+++ b/storage/xtradb/include/srv0srv.h
@@ -3,7 +3,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
-Copyright (c) 2013, 2017, MariaDB Corporation.
+Copyright (c) 2013, 2019, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1329,10 +1329,11 @@ struct srv_slot_t{
ibool suspended; /*!< TRUE if the thread is
waiting for the event of this
slot */
- ib_time_t suspend_time; /*!< time when the thread was
- suspended. Initialized by
- lock_wait_table_reserve_slot()
- for lock wait */
+ /** time(NULL) when the thread was suspended.
+ FIXME: Use my_interval_timer() or similar, to avoid bogus
+ timeouts in lock_wait_check_and_cancel() or lock_wait_suspend_thread()
+ when the system time is adjusted to the past! */
+ time_t suspend_time;
ulong wait_timeout; /*!< wait time that if exceeded
the thread will be timed out.
Initialized by
diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc
index 0cd5aff4e94..9c9c41c86e7 100644
--- a/storage/xtradb/os/os0file.cc
+++ b/storage/xtradb/os/os0file.cc
@@ -214,7 +214,10 @@ struct os_aio_slot_t{
ulint pos; /*!< index of the slot in the aio
array */
ibool reserved; /*!< TRUE if this slot is reserved */
- time_t reservation_time;/*!< time when reserved */
+ /** time(NULL) when reserved.
+ FIXME: os_aio_simulated_handle() may malfunction if
+ the system time is adjusted! */
+ time_t reservation_time;
ulint len; /*!< length of the block to read or
write */
byte* buf; /*!< buffer used in i/o */
diff --git a/storage/xtradb/sync/sync0arr.cc b/storage/xtradb/sync/sync0arr.cc
index 170adaab3a6..a1aac98d5ef 100644
--- a/storage/xtradb/sync/sync0arr.cc
+++ b/storage/xtradb/sync/sync0arr.cc
@@ -123,8 +123,10 @@ struct sync_cell_t {
has not been signalled in the
period between the reset and
wait call. */
- time_t reservation_time;/*!< time when the thread reserved
- the wait cell */
+ /** time(NULL) when the wait cell was reserved.
+ FIXME: sync_array_print_long_waits_low() may display bogus
+ warnings when the system time is adjusted to the past! */
+ time_t reservation_time;
};
/* NOTE: It is allowed for a thread to wait