Sto sperimentando la libreria mysql-binlog-connector-java
per Java. Quando eseguo query di esempio e osservo la sequenza di eventi replicati, ho notato che l'evento ROTATE
viene ricevuto due volte (con una leggera differenza). Non sono riuscito a trovare alcuna informazione in merito.
Sono curioso di sapere qual è lo scopo di tale comportamento?
output mysqlbinlog:
BINLOG '
NBOeVxMBAAAAMAAAAOEPAAAAAEYAAAAAAAEABHRlc3QAA2ZvbwADAwMDAAV0++x3
NBOeVx4BAAAASgAAACsQAAAAAEYAAAAAAAEAAgAD//gBAAAAAgAAAAEAAAD4AQAAAAEAAAABAAAA
+AEAAAABAAAAAQAAAEGalIw=
'/*!*/;
# at 4139
#160731 15:03:16 server id 1 end_log_pos 4170 CRC32 0xe46a11ca Xid = 102
COMMIT/*!*/;
# at 4170
#160731 15:03:16 server id 1 end_log_pos 4218 CRC32 0x49f876e3 Rotate to mysqld-bin.000865 pos: 4
# at 4
#700101 0:00:00 server id 1 end_log_pos 0 CRC32 0xa4f216d7 Rotate to mysqld-bin.000865 pos: 4
# at 4
#160731 15:03:16 server id 1 end_log_pos 120 CRC32 0x572d4724 Start: binlog v 4, server v 5.6.31-log created 160731 15:03:16
BINLOG '
NBOeVw8BAAAAdAAAAHgAAAAAAAQANS42LjMxLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAASRH
LVc=
output mysql-binlog-connector-java:
Event{header=EventHeaderV4{timestamp=1469977396000, eventType=ROTATE, serverId=1, headerLength=19, dataLength=29, nextPosition=4218, flags=0}, data=RotateEventData{binlogFilename='mysqld-bin.000865', binlogPosition=4}}
Event{header=EventHeaderV4{timestamp=0, eventType=ROTATE, serverId=1, headerLength=19, dataLength=29, nextPosition=0, flags=32}, data=RotateEventData{binlogFilename='mysqld-bin.000865', binlogPosition=4}}