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

Clarify some comments

parent 6268bdad
......@@ -2,7 +2,7 @@
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
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
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -3436,13 +3436,13 @@ buf_page_optimistic_get(
return(TRUE);
}
/** Given a tablespace id and page number tries to get that page. If the
page is not in the buffer pool it is not loaded and NULL is returned.
Suitable for using when holding the lock_sys_t::mutex.
@param[in] page_id page id
@param[in] mtr mini-transaction
@return pointer to a page or NULL */
buf_block_t* buf_page_try_get(const page_id_t page_id, mtr_t *mtr)
/** Try to U-latch a page.
Suitable for using when holding the lock_sys latches (as it avoids deadlock).
@param[in] page_id page identifier
@param[in,out] mtr mini-transaction
@return the block
@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)
{
ut_ad(mtr);
ut_ad(mtr->is_active());
......
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
......@@ -232,13 +232,13 @@ buf_page_optimistic_get(
ib_uint64_t modify_clock,/*!< in: modify clock value */
mtr_t* mtr); /*!< in: mini-transaction */
/** Given a tablespace id and page number tries to get that page. If the
page is not in the buffer pool it is not loaded and NULL is returned.
Suitable for using when holding the lock_sys_t::mutex.
@param[in] page_id page id
@param[in] mtr mini-transaction
@return pointer to a page or NULL */
buf_block_t* buf_page_try_get(const page_id_t page_id, mtr_t *mtr);
/** Try to U-latch a page.
Suitable for using when holding the lock_sys latches (as it avoids deadlock).
@param[in] page_id page identifier
@param[in,out] mtr mini-transaction
@return the block
@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);
/** Get read access to a compressed page (usually of type
FIL_PAGE_TYPE_ZBLOB or FIL_PAGE_TYPE_ZBLOB2).
......
/*****************************************************************************
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
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)
ut_a(!is_recovered);
ut_ad(!rsegs.m_redo.rseg);
/* Note: We are asserting without holding the lock mutex. But
that is OK because this transaction is not waiting and cannot
be rolled back and no new locks can (or should) be added
because it is flagged as a non-locking read-only transaction. */
/* Note: We do not have to hold any lock_sys latch here, because
this is a non-locking transaction. */
ut_a(UT_LIST_GET_LEN(lock.trx_locks) == 0);
/* 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