MCPcopy Create free account
hub / github.com/MariaDB/server / flush_write_buffer_if_file_backed

Function flush_write_buffer_if_file_backed

sql/log.cc:2072–2084  ·  view source on GitHub ↗

Ensures that the input IO Cache is consistent with where its data is stored, i.e that the data is entirely either stored in-memory or backed by a temporary file. In actuality, it is simple: if the IO Cache is actively backed by a temporary file (i.e. the transaction or statement data is sufficiently large to exceed its respective binlog_cache_size), then ensure all data is flushed to the

Source from the content-addressed store, hash-verified

2070 Returns TRUE on success, FALSE on error.
2071*/
2072inline my_bool flush_write_buffer_if_file_backed(IO_CACHE *info)
2073{
2074 my_bool ret= 0;
2075 DBUG_ENTER("binlog_flush_cache_log_to_disk");
2076 DBUG_ASSERT(info);
2077 DBUG_ASSERT(!info->error);
2078 DBUG_EXECUTE_IF("simulate_binlog_tmp_file_no_space_left_on_flush",
2079 { DBUG_SET("+d,simulate_file_write_error"); });
2080 ret= info->pos_in_file && flush_io_cache(info);
2081 DBUG_EXECUTE_IF("simulate_binlog_tmp_file_no_space_left_on_flush",
2082 { DBUG_SET("-d,simulate_file_write_error"); });
2083 DBUG_RETURN(ret);
2084}
2085
2086/*
2087 This function flushes a cache upon commit/rollback.

Callers 1

binlog_flush_cacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected