Commit 3dabe637 authored by Marko Mäkelä's avatar Marko Mäkelä

Clarify some comments

parent 6268bdad
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Copyright (c) 2013, 2020, MariaDB Corporation. Copyright (c) 2013, 2021, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described Google, Inc. Those modifications are gratefully acknowledged and are described
...@@ -3436,13 +3436,13 @@ buf_page_optimistic_get( ...@@ -3436,13 +3436,13 @@ buf_page_optimistic_get(
return(TRUE); return(TRUE);
} }
/** Given a tablespace id and page number tries to get that page. If the /** Try to U-latch a page.
page is not in the buffer pool it is not loaded and NULL is returned. Suitable for using when holding the lock_sys latches (as it avoids deadlock).
Suitable for using when holding the lock_sys_t::mutex. @param[in] page_id page identifier
@param[in] page_id page id @param[in,out] mtr mini-transaction
@param[in] mtr mini-transaction @return the block
@return pointer to a page or NULL */ @retval nullptr if an U-latch cannot be granted immediately */
buf_block_t* buf_page_try_get(const page_id_t page_id, mtr_t *mtr) buf_block_t *buf_page_try_get(const page_id_t page_id, mtr_t *mtr)
{ {
ut_ad(mtr); ut_ad(mtr);
ut_ad(mtr->is_active()); ut_ad(mtr->is_active());
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2020, MariaDB Corporation. Copyright (c) 2013, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -232,13 +232,13 @@ buf_page_optimistic_get( ...@@ -232,13 +232,13 @@ buf_page_optimistic_get(
ib_uint64_t modify_clock,/*!< in: modify clock value */ ib_uint64_t modify_clock,/*!< in: modify clock value */
mtr_t* mtr); /*!< in: mini-transaction */ mtr_t* mtr); /*!< in: mini-transaction */
/** Given a tablespace id and page number tries to get that page. If the /** Try to U-latch a page.
page is not in the buffer pool it is not loaded and NULL is returned. Suitable for using when holding the lock_sys latches (as it avoids deadlock).
Suitable for using when holding the lock_sys_t::mutex. @param[in] page_id page identifier
@param[in] page_id page id @param[in,out] mtr mini-transaction
@param[in] mtr mini-transaction @return the block
@return pointer to a page or NULL */ @retval nullptr if an U-latch cannot be granted immediately */
buf_block_t* buf_page_try_get(const page_id_t page_id, mtr_t *mtr); buf_block_t *buf_page_try_get(const page_id_t page_id, mtr_t *mtr);
/** Get read access to a compressed page (usually of type /** Get read access to a compressed page (usually of type
FIL_PAGE_TYPE_ZBLOB or FIL_PAGE_TYPE_ZBLOB2). FIL_PAGE_TYPE_ZBLOB or FIL_PAGE_TYPE_ZBLOB2).
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 2020, MariaDB Corporation. Copyright (c) 2015, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -1323,10 +1323,8 @@ inline void trx_t::commit_in_memory(const mtr_t *mtr) ...@@ -1323,10 +1323,8 @@ inline void trx_t::commit_in_memory(const mtr_t *mtr)
ut_a(!is_recovered); ut_a(!is_recovered);
ut_ad(!rsegs.m_redo.rseg); ut_ad(!rsegs.m_redo.rseg);
/* Note: We are asserting without holding the lock mutex. But /* Note: We do not have to hold any lock_sys latch here, because
that is OK because this transaction is not waiting and cannot this is a non-locking transaction. */
be rolled back and no new locks can (or should) be added
because it is flagged as a non-locking read-only transaction. */
ut_a(UT_LIST_GET_LEN(lock.trx_locks) == 0); ut_a(UT_LIST_GET_LEN(lock.trx_locks) == 0);
/* This state change is not protected by any mutex, therefore /* This state change is not protected by any mutex, therefore
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment