WL#5798: Fix interface of Binlog::log_loaded_block
Affects: Server-Prototype Only
—
Status: Un-Assigned
This is a step towards making replication a library, such that the 5.6 rpl-lib
can be plugged into the 5.5 core [WL#5675].
When LOAD DATA INFILE reads a file, it writes the parts of the file in chunks to
the binary log. Currently, it stores information about the LOAD DATA statement,
including the THD object, in a special field in struct IO_CACHE*. Then, the
IO_CACHE is configured so that it calls log_loaded_block before a new block of
data is loaded into memory. The IO_CACHE is passed as the only argument to
log_loaded_block.
We should not maintain this kind of spaghetti code, even less build interfaces
around it. The most obvious problem is that the generic datatype IO_CACHE now
contains information specific to LOAD DATA INFILE statements. That's just bad
design. If we would put IO_CACHE in a stable interface, it would mean that (1) we
cannot fix the bad design of IO_CACHE; (2) we assume IO_CACHE is stable; (3) we
assume IO_CACHE is used to load data; but we may want to change to something else
in the future. So we should change the interface to:
Binlog::log_loaded_block(THD *thd, int length, unsigned char *data);
This step is not required for the prototype of the feature to link 5.6 rpl-lib to
5.5 core, but it is required before we announce the interface as stable.
Copyright (c) 2000, 2025, Oracle Corporation and/or its affiliates. All rights reserved.