??????????????????????????????MySQLslave??????????????????????????????????????????????????????????????????е??????????????????????????????????·????????????????

????????????????????????????????????ЩDML????????????С????????????????????????????????????????

?????? show slave status??????????SQL_THREAD??IO_THREAD???????/??????

?????? ??????????????????????????????binlog?????????????relay log?в???

?????? ???涼???????????????????????????????????M/S???????????????DML?????Ч???????в???

?????????????????????????????????????????????????????λ????????????binlog??RBR?????table_map_event????е?table_id???????й????д??????????μ?????table_map_event??table_id???????????????????RBL??binlog event??

????#121031 16:25:45 server id 1  end_log_pos 3466Table_map: `test`.`tf` mapped to number 40
????#121031 16:25:45 server id 1  end_log_pos 3504 Write_rows: table id 40 flags: STMT_END_F

????BINLOG '
????ieCQUBMBAAAAKgAAAIoNAAAAACgAAAAAAAEABHRlc3QAAnRmAAIDAwAD
????ieCQUBcBAAAAJgAAALANAAAAACgAAAAAAAEAAv/8bwAAAN0AAAA=
????'/*!*/;
????### INSERT INTO test.tf
????### SET
????###   @1=111
????###   @2=221
????# at 3650
????#121031 16:25:45 server id 1  end_log_pos 3531 Xid = 71
????COMMIT/*!*/;

??????????????????table_map_event??table_id?????RBL????????????????????????????????(????????)?????DML??????????У???RBL?????н??м????????????table_map????????????????????????????????ж????????table_id??????????????????????????????????????????????????????hash??cache????hash key??????????hash??cache????????????????????RBL??????????????????У??????????????slave?????????????Щ??飬????Щ?????????????????????????????????????????????????????????????У??????????λ????????????????к???Ч??????????????????????????????????????????MySQL????????????????????table_id??

??????????????????????????????binlog??table_id???????ulong??????????????Σ?????slave????????binlog events??????????????ulong??table_id?????????????????????????RPL_TABLE_LIST??????????????????table_id?????洢binlog?е?m_table_id???????????????m_table_id??????????????????????????table_id?????uint??????????Σ??????m_table_id????uint???Χ??????????MySQL????????hash????hash????????????????????set_table(table_id)??get_table(m_table_id)????????????????key??????????????????????????????????????????????slave??relay log??DML?????б?????????????

???????????????????????????????????m_table_id?????????????????????????????????????????????????????????4000+??????????????????table_open_cache????????????m_table_id??????????????????????id??????????tablespace id?????????????????????????id?????????????δ??????????????????id???????table_open_cache????????????cache?????????????????????????????С?????????RPL_TABLE_LIST????????????????table_id??????ulong????????bug????

?????????С???????????????????????m_table_id?????????????????id??????????tablespace id??????????????????????????master????DML?Щ????-->????????alter table-->??????DML?????????????????????id?? ????????DML??slave???????????????????hash??cache?У????alter table?????Щcache?е????????и??£?????????DML?????????????????id?get_table??????????μ????????????????????????????н??и???????????????????????????m_table_id????m_table_id??????仯????????????????????μ???????

????Щ???????????????????????????????????????л?????????????????????????????????????????MySQL????????????????????????????????????????????????????????????