Bug #107117 Adjust FLUSH HOSTS documentation to make binlogging more explicit.
Submitted: 25 Apr 2022 7:38 Modified: 4 May 2022 19:53
Reporter: Simon Mudd (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0.27 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any
Tags: 8.0.27

[25 Apr 2022 7:38] Simon Mudd
Description:
https://dev.mysql.com/doc/refman/8.0/en/flush.html  refers to FLUSH HOSTS and TRUNCATE TABLE performance_schema.host_cache but does not refer to binlogging of these commands.  The TRUNCATE TABLE on P_S tables is not binlogged so there's a subtle difference in behaviour between the 2 commands.

Even though you now deprecate the use of FLUSH HOSTS I think it would be good to mention the binlogging difference as if run on a slave this will add local GTIDs events which will make master and slave inconsistent for what is essentially an irrelevant reason (in most cases).

How to repeat:
- Check docs (URL above)
- Check binlogs with both commands.
- See the FLUSH HOSTS behaviour is binlogged vs the TRUNCATE TABLE not being binlogged.

Suggested fix:
Clarify the different behaviour in https://dev.mysql.com/doc/refman/8.0/en/flush.html related to binlogging.
[25 Apr 2022 7:40] Simon Mudd
update tags
[25 Apr 2022 7:52] Frederic Descamps
Hi Simon, 

Just a little comment, when replication is involved, I always advise to use "LOCAL" to most FLUSH commands.

By default, the server writes FLUSH statements to the binary log so that they replicate to replicas. To suppress logging, specify the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL. 

examples: FLUSH LOCAL HOSTS, FLUSH LOCAL PRIVILEGES, FLUSH LOCAL STATUS, ...

See https://dev.mysql.com/doc/refman/8.0/en/flush.html

Regards,
[25 Apr 2022 7:53] Frederic Descamps
oups, sorry for the double posting url :)
[25 Apr 2022 8:12] MySQL Verification Team
Hello Simon,

Thank you for the documentation enhancement request.

regards,
Umesh
[4 May 2022 19:53] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.