MySQL 26.7.0
Source Code Documentation
buf0flu.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1995, 2026, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/buf0flu.h
29 The database buffer pool flush algorithm
30
31 Created 11/5/1995 Heikki Tuuri
32 *******************************************************/
33
34#ifndef buf0flu_h
35#define buf0flu_h
36
37#include <atomic>
38
39#include "buf0types.h"
40#include "log0types.h" /* lsn_t */
41#include "univ.i"
42#include "ut0byte.h"
43#include "ut0cpu_cache.h"
44#include "ut0link_buf.h"
45
46#include <memory>
47#ifndef UNIV_HOTBACKUP
48/** Checks if the page_cleaner is in active state. */
50
51#ifdef UNIV_DEBUG
52
53/** Value of MySQL global variable used to disable page cleaner. */
55
56#endif /* UNIV_DEBUG */
57
58/** Event to synchronise with the flushing. */
60
61/** Event to wait for one flushing step */
63
64/** lsn that indicates there is need to do sync flush operation */
65extern std::atomic<lsn_t> requested_sync_flush_lsn;
66
67class Alter_stage;
68
69/** Remove a block from the flush list of modified blocks.
70@param[in] bpage pointer to the block in question */
71void buf_flush_remove(buf_page_t *bpage);
72
73/** Relocates a buffer control block on the flush_list.
74 Note that it is assumed that the contents of bpage has already been
75 copied to dpage. */
77 buf_page_t *bpage, /*!< in/out: control block being moved */
78 buf_page_t *dpage); /*!< in/out: destination block */
79
80/** Updates the flush system data structures when a write is completed.
81@param[in] bpage pointer to the block in question */
83
84#endif /* !UNIV_HOTBACKUP */
85
86/** Check if page type is uncompressed.
87@param[in] page page frame
88@return true if uncompressed page type. */
89bool page_is_uncompressed_type(const byte *page);
90
91/** Initialize a page for writing to the tablespace.
92@param[in] block buffer block; NULL if bypassing the buffer pool
93@param[in,out] page page frame
94@param[in,out] page_zip_ compressed page, or NULL if uncompressed
95@param[in] newest_lsn newest modification LSN to the page
96@param[in] skip_checksum whether to disable the page checksum
97@param[in] skip_lsn_check true to skip check for LSN (in DEBUG) */
98void buf_flush_init_for_writing(const buf_block_t *block, byte *page,
99 void *page_zip_, lsn_t newest_lsn,
100 bool skip_checksum, bool skip_lsn_check);
101
102#ifndef UNIV_HOTBACKUP
103#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
104/** Writes a flushable page asynchronously from the buffer pool to a file.
105NOTE: block and LRU list mutexes must be held upon entering this function, and
106they will be released by this function after flushing. This is loosely based on
107buf_flush_batch() and buf_flush_page().
108@param[in,out] buf_pool buffer pool instance
109@param[in,out] block buffer control block
110@return true if the page was flushed and the mutex released */
111[[nodiscard]] bool buf_flush_page_try(buf_pool_t *buf_pool, buf_block_t *block);
112#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
113
114/** Do flushing batch of a given type.
115NOTE: The calling thread is not allowed to own any latches on pages!
116@param[in,out] buf_pool buffer pool instance
117@param[in] type flush type
118@param[in] min_n wished minimum number of blocks flushed
119(it is not guaranteed that the actual number is that big, though)
120@param[in] lsn_limit in the case BUF_FLUSH_LIST all blocks whose
121oldest_modification is smaller than this should be flushed (if their number
122does not exceed min_n), otherwise ignored
123@param[out] n_processed the number of pages which were processed is
124passed back to caller. Ignored if NULL
125@retval true if a batch was queued successfully.
126@retval false if another batch of same type was already running. */
127bool buf_flush_do_batch(buf_pool_t *buf_pool, buf_flush_t type, ulint min_n,
128 lsn_t lsn_limit, ulint *n_processed);
129
130/** This utility flushes dirty blocks from the end of the flush list of all
131buffer pool instances.
132NOTE: The calling thread is not allowed to own any latches on pages!
133@param[in] min_n wished minimum number of blocks flushed (it is
134not guaranteed that the actual number is that big, though)
135@param[in] lsn_limit in the case BUF_FLUSH_LIST all blocks whose
136oldest_modification is smaller than this should be flushed (if their number
137does not exceed min_n), otherwise ignored
138@param[out] n_processed the number of pages which were processed is
139passed back to caller. Ignored if NULL.
140@return true if a batch was queued successfully for each buffer pool
141instance. false if another batch of same type was already running in
142at least one of the buffer pool instance */
143bool buf_flush_lists(ulint min_n, lsn_t lsn_limit, ulint *n_processed);
144
145/** This function picks up a single page from the tail of the LRU
146list, flushes it (if it is dirty), removes it from page_hash and LRU
147list and puts it on the free list. It is called from user threads when
148they are unable to find a replaceable page at the tail of the LRU
149list i.e.: when the background LRU flushing in the page_cleaner thread
150is not fast enough to keep pace with the workload.
151@param[in,out] buf_pool buffer pool instance
152@return true if success. */
154
155/** Waits until there's no flush of the given type from given BP instance.
156Note that in case of BUF_FLUSH_LIST and BUF_FLUSH_LRU we also make sure there's
157no ongoing batch initialization (which could lead to flushes).
158The BUF_FLUSH_SINGLE_PAGE does not have batch initialization.
159Note, that we return as soon as there is no flush, but in general a new one
160could start right after we've returned (it's up to the caller to prevent this).
161If buf_pool is nullptr, then it will await a moment with no flushes for each
162BP instance in turn, which in general doesn't imply there was a single moment
163when all instances were quiescent - it's up to the caller to ensure that.
164
165@param[in] buf_pool
166 The specific buffer pool instance to check.
167 Can be null, if we want to wait for each buf_pool in turn.
168@param[in] flush_type Flush type. */
170
171/** This function should be called at a mini-transaction commit, if a page was
172modified in it. Puts the block to the list of modified blocks, if it not
173already in it.
174@param[in] block block which is modified
175@param[in] start_lsn start lsn of the first mtr in a set of mtr's
176@param[in] end_lsn end lsn of the last mtr in the set of mtr's
177@param[in] observer flush observer */
178static inline void buf_flush_note_modification(buf_block_t *block,
179 lsn_t start_lsn, lsn_t end_lsn,
180 Flush_observer *observer);
181
182/** Returns true if the file page block is immediately suitable for replacement,
183i.e., the transition FILE_PAGE => NOT_USED allowed. The caller must hold the
184LRU list and block mutexes.
185@param[in] bpage buffer control block, must be buf_page_in_file() and
186 in the LRU list
187@return true if can replace immediately */
188bool buf_flush_ready_for_replace(const buf_page_t *bpage);
189
190#ifdef UNIV_DEBUG
191struct SYS_VAR;
192
193/** Disables page cleaner threads (coordinator and workers).
194It's used by: SET GLOBAL innodb_page_cleaner_disabled_debug = 1 (0).
195@param[in] thd thread handle
196@param[in] var pointer to system variable
197@param[out] var_ptr where the formal string goes
198@param[in] save immediate result from check function */
200 void *var_ptr,
201 const void *save);
202#endif /* UNIV_DEBUG */
203
204/** Initialize page_cleaner. */
206
207#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
208/** Validates the flush list.
209 @return true if ok */
210bool buf_flush_validate(buf_pool_t *buf_pool);
211#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
212
213/** Writes a flushable page asynchronously from the buffer pool to a file.
214NOTE: 1. in simulated aio we must call os_aio_simulated_wake_handler_threads
215after we have posted a batch of writes! 2. buf_page_get_mutex(bpage) must be
216held upon entering this function. The LRU list mutex must be held if flush_type
217== BUF_FLUSH_SINGLE_PAGE. Both mutexes will be released by this function if it
218returns true.
219@param[in] buf_pool buffer pool instance
220@param[in] bpage buffer control block
221@param[in] flush_type type of flush
222@param[in] sync true if sync IO request
223@return true if page was flushed */
224bool buf_flush_page(buf_pool_t *buf_pool, buf_page_t *bpage,
225 buf_flush_t flush_type, bool sync);
226
227/** Check if the block is modified and ready for flushing.
228Requires buf_page_get_mutex(bpage).
229@param[in] bpage buffer control block, must be buf_page_in_file()
230@param[in] flush_type type of flush
231@return true if can flush immediately */
232[[nodiscard]] bool buf_flush_ready_for_flush(buf_page_t *bpage,
234
235/** Executes fsync for all tablespaces, to fsync all pages written to disk. */
236void buf_flush_fsync();
237
238/** Synchronously flush dirty blocks from the end of the flush list of all
239 buffer pool instances. NOTE: The calling thread is not allowed to own any
240 latches on pages! */
242
243/** Checks if all flush lists are empty. It is supposed to be used in
244single thread, during startup or shutdown. Hence it does not acquire
245lock and it is caller's responsibility to guarantee that flush lists
246are not changed in background.
247@return true if all flush lists were empty. */
249
250#ifdef UNIV_DEBUG
251/** Counts how many dirty pages that belong to a tablespace with a specified ID
252are in all BufferPool instances.
253@param[in] space_id ID of tablespace for which to count the dirty pages.
254@return number of dirty pages present in all BufferPool instances. */
256#endif /* UNIV_DEBUG */
257
258/** Flushes all dirty pages inside all buffer pool instances belonging to a
259given tablespace or belonging to the specified flush observer. This will handle
260all pages that were dirty before this call - in case there are more pages made
261dirty during the call, they may get not flushed. Exactly one of @p id and @p
262observer can be specified valid. If a transaction is specified, its flush
263observer must be the same as specified in the @p observer and it will be used to
264check if the transaction was interrupted, and in such case:
265- if @p observer is not nullptr, the dirty pages are removed from the flush
266list. The pages still remain dirty and a part of LRU and are evicted from the
267list as they age towards the tail of the LRU.
268- otherwise all not yet processed dirty pages will be left in the flush list.
269@param[in] id Tablespace ID to flush pages from or SPACE_UNKNOWN iff
270 the @p observer is not nullptr.
271@param[in] observer Pointer to a FlushObserver to identify specific pages
272 or nullptr.
273@param[in] trx Pointer to a transaction to check if the operation was
274 interrupted or nullptr if such checks should not be
275 performed. */
276void buf_flush_pages(space_id_t id, Flush_observer *observer, const trx_t *trx);
277
278/** We use Flush_observer to track flushing of non-redo logged pages in bulk
279create index(btr0load.cc).Since we disable redo logging during a index build,
280we need to make sure that all dirty pages modified by the index build are
281flushed to disk before any redo logged operations go to the index. */
282
284 public:
285 /** Constructor
286 @param[in] trx trx instance
287 @param[in,out] stage PFS progress monitoring instance, it's used by
288 ALTER TABLE. It is passed to log_preflush_pool_modified_pages() for
289 accounting. */
290 Flush_observer(const trx_t &trx, Alter_stage *stage) noexcept;
291
292 /** Destructor */
293 ~Flush_observer() noexcept;
294
295 /** Print information about the current object.
296 @param[in,out] out output stream to be used.
297 @return the output stream. */
298 std::ostream &print(std::ostream &out) const;
299
300 /** Check pages have been flushed and removed from the flush list
301 in a buffer pool instance.
302 @param[in] instance_no buffer pool instance no
303 @return true if the pages were removed from the flush list */
304 bool is_complete(size_t instance_no) {
305 ut_ad(m_flushed[instance_no].load() >= 0);
306 ut_ad(m_removed[instance_no].load() >= 0);
307 return m_interrupted ||
308 (m_flushed[instance_no].load() == m_removed[instance_no].load());
309 }
310
311 /** Interrupt observer not to wait. */
312 void interrupted() { m_interrupted = true; }
313
314 /** Check whether trx is interrupted
315 @return true if trx is interrupted */
316 bool check_interrupted();
317
318 /** Flush dirty pages. */
319 void flush();
320
321 /** Notify observer of flushing a page
322 @param[in] buf_pool buffer pool instance
323 @param[in] bpage buffer page to flush */
324 void notify_flush(buf_pool_t *buf_pool, buf_page_t *bpage);
325
326 /** Notify observer of removing a page from flush list
327 @param[in] buf_pool buffer pool instance
328 @param[in] bpage buffer page flushed */
329 void notify_remove(buf_pool_t *buf_pool, buf_page_t *bpage);
330
331 /** Returns the transaction the observer was created for. */
332 const trx_t &get_trx() const { return m_trx; }
333
334 private:
335 using Counter = std::atomic_int;
336 using Counters = std::vector<Counter, ut::allocator<Counter>>;
337
338#ifdef UNIV_DEBUG
339 [[nodiscard]] bool validate() const noexcept;
340#endif /* UNIV_DEBUG */
341
342 /** Trx instance */
343 const trx_t &m_trx;
344
345 /** Performance schema accounting object, used by ALTER TABLE.
346 If not nullptr, then stage->begin_phase_flush() will be called initially,
347 specifying the number of pages to be attempted to be flushed and
348 subsequently, stage->inc() will be called for each page we attempt to
349 flush. */
351
352 /** Flush request sent, per buffer pool. */
354
355 /** Flush request finished, per buffer pool. */
357
358 /** Number of pages using this instance. */
360
361 /** True if the operation was interrupted. */
363};
364
366
367// Forward declaration.
369
370// Simplified type alias for the aligned unique_ptr
373 ut::detail::Aligned_deleter<Buf_flush_list_added_lsns>>;
374
375/** Tracks the concurrent executions of adding dirty pages to the flush lists.
376It allows to relax order in which dirty pages have to be added to the flush
377lists and helps in advancing the checkpoint LSN.
378Note : Earlier it was known as recent_closed buffer. */
380 public:
381 /** Factory method that creates a dynamically allocated instance that is
382 aligned to the cache line boundary. This is needed since C++17 doesn't
383 guarantee allocating aligned types dynamically */
385
386 /** Assume that the start_lsn is the start lsn of the first mini-transaction,
387 for which report_added(mtr.start_lsn, mtr.end_lsn) was not yet called.
388 Before the call smallest_not_added_lsn() can't be larger than start_lsn.
389 During the call smallest_not_added_lsn() becomes start_lsn.
390 @param[in] start_lsn LSNs that are already flushed.*/
391 void assume_added_up_to(lsn_t start_lsn);
392
393 /** Used to report that we know that all changes in a specified range of lsns
394 were already applied to pages in BP and all these pages were already added to
395 corresponding flush lists. The committing mtr should use this function to
396 report that it has added all the pages that it has dirtied to corresponding
397 flush lists already.
398 The newest_modification should be the mtr->commit_lsn().
399 The oldest_modification should be the start_lsn assigned to the mtr
400 (which equals commit_lsn() of the previous mtr).
401
402 Information from these reports is used by smallest_not_added_lsn() to
403 establish the smallest not yet reported lsn, which in turn can be used by page
404 cleaners, or other mtrs which are currently waiting for their turn in
405 wait_to_add().
406 @param[in] oldest_modification start lsn of the range
407 @param[in] newest_modification end lsn fo the range */
408 void report_added(lsn_t oldest_modification, lsn_t newest_modification);
409
410 /** The flush lists are not completely sorted, and the amount of disorder is
411 limited by the order_lag() - which is controlled by immutable
412 srv_buf_flush_list_added_size sysvar - in the following way. If page A is
413 added before page B in a flush_list, then it must hold that
414 A.oldest_modification returned value < B.oldest_modification.
415 @return the maximum lsn distance the subsequent elements of the flush list can
416 lag behind the first element w.r.t. oldest_modification */
417 uint64_t order_lag();
418
419 /** Return lsn up to which we know that all dirty pages with smaller
420 oldest_modification were added to the flush list.
421 @return The smallest lsn for which there was no call to assume_added_up_to(y)
422 with lsn<y nor to report_added(x,y) with x<=lsn<y yet */
423 lsn_t smallest_not_added_lsn();
424
425 /** Wait until it is safe to add dirty pages with a given oldest_modification
426 lsn to flush list without exceeding the disorder limit imposed by older_lag().
427 This function will block and wait until all the pages having
428 page.oldest_modification smaller than oldest_modification - older_lag() are
429 reported to be added to flush list by other threads.
430 @param[in] oldest_modification Oldest LSN that does not violate the
431 order_lag() */
432 void wait_to_add(lsn_t oldest_modification);
433
434 private:
435 /** Ring buffer that keeps track of the ranges of LSNs added to
436 flush_list(s) already.*/
438
439 /** Constructor. Clients must use factory method to create an instance */
441
442 template <typename T, typename... Args>
444 std::size_t alignment, Args &&...args);
445};
446
448#endif /* !UNIV_HOTBACKUP */
449
450#include "buf0flu.ic"
451
452#endif
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:49
Buf_flush_list_added_lsns_aligned_ptr buf_flush_list_added
Tracks adding dirty pages to the flush list.
Definition: buf0buf.cc:333
std::atomic< lsn_t > requested_sync_flush_lsn
lsn that indicates there is need to do sync flush operation
Definition: buf0flu.cc:93
void buf_flush_fsync()
Executes fsync for all tablespaces, to fsync all pages written to disk.
Definition: buf0flu.cc:3349
void buf_flush_pages(space_id_t id, Flush_observer *observer, const trx_t *trx)
Flushes all dirty pages inside all buffer pool instances belonging to a given tablespace or belonging...
Definition: buf0flu.cc:4010
std::unique_ptr< Buf_flush_list_added_lsns, ut::detail::Aligned_deleter< Buf_flush_list_added_lsns > > Buf_flush_list_added_lsns_aligned_ptr
Definition: buf0flu.h:373
void buf_flush_write_complete(buf_page_t *bpage)
Updates the flush system data structures when a write is completed.
Definition: buf0flu.cc:687
bool buf_flush_do_batch(buf_pool_t *buf_pool, buf_flush_t type, ulint min_n, lsn_t lsn_limit, ulint *n_processed)
Do flushing batch of a given type.
Definition: buf0flu.cc:1811
void buf_flush_sync_all_buf_pools()
Synchronously flush dirty blocks from the end of the flush list of all buffer pool instances.
Definition: buf0flu.cc:3377
bool buf_flush_single_page_from_LRU(buf_pool_t *buf_pool)
This function picks up a single page from the tail of the LRU list, flushes it (if it is dirty),...
Definition: buf0flu.cc:1896
bool buf_flush_validate(buf_pool_t *buf_pool)
Validates the flush list.
Definition: buf0flu.cc:3444
bool buf_flush_lists(ulint min_n, lsn_t lsn_limit, ulint *n_processed)
This utility flushes dirty blocks from the end of the flush list of all buffer pool instances.
Definition: buf0flu.cc:1834
void buf_flush_page_cleaner_disabled_debug_update(THD *thd, SYS_VAR *var, void *var_ptr, const void *save)
Disables page cleaner threads (coordinator and workers).
Definition: buf0flu.cc:2841
bool buf_flush_page(buf_pool_t *buf_pool, buf_page_t *bpage, buf_flush_t flush_type, bool sync)
Writes a flushable page asynchronously from the buffer pool to a file.
Definition: buf0flu.cc:1051
void buf_flush_remove(buf_page_t *bpage)
Remove a block from the flush list of modified blocks.
Definition: buf0flu.cc:575
os_event_t buf_flush_tick_event
Event to wait for one flushing step.
Definition: buf0flu.cc:110
bool buf_flush_page_try(buf_pool_t *buf_pool, buf_block_t *block)
Writes a flushable page asynchronously from the buffer pool to a file.
Definition: buf0flu.cc:1177
os_event_t buf_flush_event
Event to synchronise with the flushing.
Definition: buf0flu.cc:107
void buf_flush_await_no_flushing(buf_pool_t *buf_pool, buf_flush_t flush_type)
Waits until there's no flush of the given type from given BP instance.
Definition: buf0flu.cc:1799
static void buf_flush_note_modification(buf_block_t *block, lsn_t start_lsn, lsn_t end_lsn, Flush_observer *observer)
This function should be called at a mini-transaction commit, if a page was modified in it.
void buf_flush_relocate_on_flush_list(buf_page_t *bpage, buf_page_t *dpage)
Relocates a buffer control block on the flush_list.
Definition: buf0flu.cc:644
void buf_flush_page_cleaner_init()
Initialize page_cleaner.
Definition: buf0flu.cc:2551
lsn_t get_flush_sync_lsn() noexcept
Get the lsn up to which data pages are to be synchronously flushed.
Definition: buf0flu.cc:98
bool buf_are_flush_lists_empty_validate()
Checks if all flush lists are empty.
Definition: buf0flu.cc:290
bool buf_flush_ready_for_replace(const buf_page_t *bpage)
Returns true if the file page block is immediately suitable for replacement, i.e.,...
Definition: buf0flu.cc:476
bool innodb_page_cleaner_disabled_debug
Value of MySQL global variable used to disable page cleaner.
Definition: buf0flu.cc:214
size_t buf_flush_get_dirty_pages_count_for_space(space_id_t space_id)
Counts how many dirty pages that belong to a tablespace with a specified ID are in all BufferPool ins...
Definition: buf0flu.cc:3514
bool buf_flush_ready_for_flush(buf_page_t *bpage, buf_flush_t flush_type)
Check if the block is modified and ready for flushing.
Definition: buf0flu.cc:569
void buf_flush_init_for_writing(const buf_block_t *block, byte *page, void *page_zip_, lsn_t newest_lsn, bool skip_checksum, bool skip_lsn_check)
Initialize a page for writing to the tablespace.
Definition: buf0flu.cc:758
bool buf_flush_page_cleaner_is_active()
Checks if the page_cleaner is in active state.
Definition: buf0flu.cc:2547
bool page_is_uncompressed_type(const byte *page)
Check if page type is uncompressed.
Definition: buf0flu.cc:734
The database buffer pool flush algorithm.
The database buffer pool global types for the directory.
buf_flush_t
Flags for flush types.
Definition: buf0types.h:68
Class used to report ALTER TABLE progress via performance_schema.
Definition: ut0stage.h:81
Tracks the concurrent executions of adding dirty pages to the flush lists.
Definition: buf0flu.h:379
We use Flush_observer to track flushing of non-redo logged pages in bulk create index(btr0load....
Definition: buf0flu.h:283
Counters m_flushed
Flush request sent, per buffer pool.
Definition: buf0flu.h:353
void flush()
Flush dirty pages.
Definition: buf0flu.cc:4068
Counters m_removed
Flush request finished, per buffer pool.
Definition: buf0flu.h:356
bool validate() const noexcept
Definition: buf0flu.cc:4110
const trx_t & m_trx
Trx instance.
Definition: buf0flu.h:343
void interrupted()
Interrupt observer not to wait.
Definition: buf0flu.h:312
const trx_t & get_trx() const
Returns the transaction the observer was created for.
Definition: buf0flu.h:332
std::ostream & print(std::ostream &out) const
Print information about the current object.
Definition: buf0flu.cc:4119
bool check_interrupted()
Check whether trx is interrupted.
Definition: buf0flu.cc:4044
~Flush_observer() noexcept
Destructor.
Definition: buf0flu.cc:4034
Flush_observer(const trx_t &trx, Alter_stage *stage) noexcept
Constructor.
Definition: buf0flu.cc:4018
void notify_remove(buf_pool_t *buf_pool, buf_page_t *bpage)
Notify observer of removing a page from flush list.
Definition: buf0flu.cc:4062
bool m_interrupted
True if the operation was interrupted.
Definition: buf0flu.h:362
void notify_flush(buf_pool_t *buf_pool, buf_page_t *bpage)
Notify observer of flushing a page.
Definition: buf0flu.cc:4052
std::vector< Counter, ut::allocator< Counter > > Counters
Definition: buf0flu.h:336
Counter m_n_ref_count
Number of pages using this instance.
Definition: buf0flu.h:359
Alter_stage * m_stage
Performance schema accounting object, used by ALTER TABLE.
Definition: buf0flu.h:350
bool is_complete(size_t instance_no)
Check pages have been flushed and removed from the flush list in a buffer pool instance.
Definition: buf0flu.h:304
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: buf0buf.h:1156
int page
Definition: ctype-mb.cc:1226
flush_type
Definition: my_sys.h:300
#define T
Definition: jit_executor_value.cc:373
Redo log basic types.
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:63
Sharded atomic counter.
Definition: ut0counter.h:221
bool load(THD *, const dd::String_type &fname, dd::String_type *buf)
Read an sdi file from disk and store in a buffer.
Definition: sdi_file.cc:308
Definition: packet_based_table_with_cursor.h:36
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
static mysql_service_status_t create(my_h_string *) noexcept
Definition: mysql_string_all_empty.cc:43
Define std::hash<Gtid>.
Definition: gtid.h:355
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
constexpr size_t INNODB_CACHE_LINE_SIZE
CPU cache line size.
Definition: ut0cpu_cache.h:41
T * aligned_new_withkey(PSI_memory_key_t key, std::size_t alignment, Args &&...args)
Dynamically allocates storage for an object of type T at address aligned to the requested alignment.
Definition: ut0new.h:1436
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2284
required string key
Definition: replication_asynchronous_connection_failover.proto:60
required string type
Definition: replication_group_member_actions.proto:34
Definition: system_variables_bits.h:153
The buffer control block structure.
Definition: buf0buf.h:1756
The buffer pool structure.
Definition: buf0buf.h:2285
InnoDB condition variable.
Definition: os0event.cc:63
Definition: trx0trx.h:670
Light-weight and type-safe wrapper around the PSI_memory_key that eliminates the possibility of intro...
Definition: ut0new.h:178
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:403
Utilities for byte operations.
Utilities related to CPU cache.
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:109