{"id":19898,"date":"2019-11-27T14:47:36","date_gmt":"2019-11-27T05:47:36","guid":{"rendered":"https:\/\/labs.gree.jp\/blog\/?p=19898"},"modified":"2021-10-08T19:31:23","modified_gmt":"2021-10-08T10:31:23","slug":"post19898","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2019\/11\/19898\/","title":{"rendered":"\u30c1\u30e7\u30c3\u30c8\u30ef\u30ab\u30eb Row-Based Replication\u30fb\u305d\u306e\uff15"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u308f\u3002\u305b\u3058\u307e\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u3082 replication \u306e\u8a71\u3092\u3057\u307e\u3059\u3002<\/p>\n<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>\u7b2c\uff15\u56de\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f TABLE_MAP_EVENT \u306b\u95a2\u3059\u308b\u8a71\u3092\u3057\u307e\u3059\u3002 MySQL Internal Manual \u3067\u306f\u3053\u3061\u3089\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/internals\/en\/table-map-event.html\">14.10.1 TABLE_MAP_EVENT<\/a><\/p>\n<h2>\u89e3\u8aac<\/h2>\n<p>TABLE_MAP_EVENT \u306b\u306f\u3001\u66f4\u65b0\u5bfe\u8c61\u306e database_name.table_name \u3068\u3001\u66f4\u65b0\u5bfe\u8c61\u306e column\u306e\u578b \u306e\u60c5\u5831\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u578b\u306e compatibility check \u3084 replicate-do-db \u306a\u3069\u306e\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u65e9\u901f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u3093\u3067\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>SQL Thread \u3067 handle_slave_sql() \u304b\u3089\u964d\u308a\u3066\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L6576\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L6576<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L6842\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L6842<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4680\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4680<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4782\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4782<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4246\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4246<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4323\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_slave.cc#L4323<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L3627\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L3627<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L3644\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L3644<\/a><\/li>\n<\/ul>\n<p>\u307e\u305a\u306f Table_map_log_event::do_apply_event()<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10688\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10688<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10731\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10731<\/a><\/li>\n<\/ul>\n<pre class=\"start-line:10731 lang:c++\" ><code>  enum_tbl_map_status tblmap_status = check_table_map(rli, table_list);<\/code><\/pre>\n<p>TABLE_MAP_EVENT \u306b\u542b\u307e\u308c\u308b database_name.table_name \u304c replication filter \u306b\u30d2\u30c3\u30c8 \u3059\u308b\u304b\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10651-L10681\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10651-L10681<\/a>  <\/li>\n<\/ul>\n<pre class=\"start-line:10651 lang:c++\" ><code>static enum_tbl_map_status check_table_map(Relay_log_info const *rli,\n                                           RPL_TABLE_LIST *table_list) {\n  DBUG_ENTER(\"check_table_map\");\n  enum_tbl_map_status res = OK_TO_PROCESS;\n\n  if (rli->info_thd->slave_thread \/* filtering is for slave only *\/ &&\n      (!rli->rpl_filter->db_ok(table_list->db) ||\n       (rli->rpl_filter->is_on() &&\n        !rli->rpl_filter->tables_ok(\"\", table_list))))\n    if (rli->info_thd->get_transaction()->xid_state()->has_state(\n            XID_STATE::XA_ACTIVE))\n      res = FILTERED_WITH_XA_ACTIVE;\n    else\n      res = FILTERED_OUT;\n  else {\n    RPL_TABLE_LIST *ptr = static_cast<RPL_TABLE_LIST *>(rli->tables_to_lock);\n    for (uint i = 0; ptr && (i < rli->tables_to_lock_count);\n         ptr = static_cast<RPL_TABLE_LIST *>(ptr->next_local), i++) {\n      if (ptr->table_id == table_list->table_id) {\n        if (strcmp(ptr->db, table_list->db) ||\n            strcmp(ptr->alias, table_list->table_name) ||\n            ptr->lock_descriptor().type !=\n                TL_WRITE)  \/\/ the ::do_apply_event always sets TL_WRITE\n          res = SAME_ID_MAPPING_DIFFERENT_TABLE;\n        else\n          res = SAME_ID_MAPPING_SAME_TABLE;\n\n        break;\n      }\n    }\n  }<\/code><\/pre>\n<p>\u66f4\u65b0\u5bfe\u8c61\u3067\u3042\u308b\u3068\u5224\u65ad\u3055\u308c\u308c\u3070\u3001\u305d\u306e table \u306f  rli->tables_to_lock \u306b\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10731-L10758\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L10731-L10758<\/a><\/li>\n<\/ul>\n<pre class=\"start-line:10731 lang:c++\" ><code>  enum_tbl_map_status tblmap_status = check_table_map(rli, table_list);\n  if (tblmap_status == OK_TO_PROCESS) {\n    DBUG_ASSERT(thd->lex->query_tables != table_list);\n\n    \/*\n      Use placement new to construct the table_def instance in the\n      memory allocated for it inside table_list.\n\n      The memory allocated by the table_def structure (i.e., not the\n      memory allocated *for* the table_def structure) is released\n      inside Relay_log_info::clear_tables_to_lock() by calling the\n      table_def destructor explicitly.\n    *\/\n    new (&table_list->m_tabledef)\n        table_def(m_coltype, m_colcnt, m_field_metadata, m_field_metadata_size,\n                  m_null_bits, m_flags);\n\n    table_list->m_tabledef_valid = true;\n    table_list->m_conv_table = NULL;\n    table_list->open_type = OT_BASE_ONLY;\n\n    \/*\n      We record in the slave's information that the table should be\n      locked by linking the table into the list of tables to lock.\n    *\/\n    table_list->next_global = table_list->next_local = rli->tables_to_lock;\n    const_cast<Relay_log_info *>(rli)->tables_to_lock = table_list;\n    const_cast<Relay_log_info *>(rli)->tables_to_lock_count++;<\/code><\/pre>\n<p>Rows_log_event::do_apply_event() \u3082\u8aad\u3093\u3067\u307f\u307e\u3057\u3087\u3046<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9549\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9549<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9567-L9783\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9567-L9783<\/a><\/li>\n<\/ul>\n<p>9567 \u884c\u76ee\u304b\u3089\u59cb\u307e\u308b if \u306e\u30d6\u30ed\u30c3\u30af\u306f 9783 \u884c\u76ee\u307e\u3067\u7d9a\u304d\u307e\u3059\u3002\u305f\u3044\u3078\u3093\u9577\u3044\u3067\u3059\u3002<\/p>\n<p>\u3067\u3001\u3053\u306e\u4e2d\u3067 Table_map_log_event::do_apply_event() \u3067\u767b\u9332\u3055\u308c\u305f\u3001\u66f4\u65b0\u5bfe\u8c61\u3067\u3042\u308b table \u306b\u95a2\u3059\u308b\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9709-L9711\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9709-L9711<\/a><\/li>\n<\/ul>\n<pre class=\"start-line:9709 lang:c++\" ><code>        if (!ptr->m_tabledef.compatible_with(thd,\n                                             const_cast<Relay_log_info *>(rli),\n                                             ptr->table, &conv_table)) {<\/code><\/pre>\n<p>table \u306e compatibility check \u3068\u3044\u3046\u3053\u3068\u3067\u3001\u578b\u30c1\u30a7\u30c3\u30af\u304c\u5165\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L449\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L449<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L478-L485\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L478-L485<\/a><\/li>\n<\/ul>\n<pre class=\"start-line:478 lang:c++\" ><code>  for (uint col = 0; col < cols_to_check; ++col) {\n    Field *const field = table->field[col];\n    int order;\n    if (can_convert_field_to(field, type(col), field_metadata(col), rli,\n                             m_flags, &order)) {\n      DBUG_PRINT(\"debug\", (\"Checking column %d -\"\n                           \" field '%s' can be converted - order: %d\",\n                           col, field->field_name, order));<\/code><\/pre>\n<p>\u578b\u5909\u63db\u306b\u95a2\u3059\u308b\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308b\u969b\u3001<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L227\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L227<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/labs.gree.jp\/blog\/2019\/10\/19628\/\">\u30c1\u30e7\u30c3\u30c8\u30ef\u30ab\u30eb Row-Based Replication\u30fb\u305d\u306e\uff12<\/a>\u3067\u3082\u8a00\u53ca\u3057\u305f\u3001DATETIME \u3084 TIMESTAMP \u3082\u30c1\u30a7\u30c3\u30af\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L265-L292\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L265-L292<\/a><\/li>\n<\/ul>\n<pre class=\"start-line:265 lang:c++\" ><code>  } else if (metadata == 0 &&\n             (timestamp_cross_check(field->real_type(), source_type) ||\n              datetime_cross_check(field->real_type(), source_type) ||\n              time_cross_check(field->real_type(), source_type))) {\n    \/*\n      In the above condition, we are taking care\n      of case where\n      1) Master having old TIME, TIMESTAMP, DATETIME\n      and slave have new TIME2, TIMESTAMP2, DATETIME2\n      or\n      2) Master having new TIMESTAMP2, DATETIME2, TIME2\n      with fraction part zero and slave have TIME,\n      TIMESTAMP, DATETIME.\n      We need second condition, as when we are\n      upgrading from 5.5 to 5.6 TIME, TIMESTAMP,\n      DATETIME columns are not upgraded to TIME(0),\n      TIMESTAMP(0), DATETIME(0).\n      So to support these conversion we are putting this\n      condition.\n    *\/\n    \/*\n      TS-TODO: conversion from FSP1>FSP2.\n      Can do non-lossy conversion\n      from old TIME, TIMESTAMP, DATETIME\n      to new TIME(0), TIMESTAMP(0), DATETIME(0).\n    *\/\n    *order_var = -1;\n    DBUG_RETURN(true);<\/code><\/pre>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L167-L175\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/rpl_utility.cc#L167-L175<\/a><\/li>\n<\/ul>\n<pre class=\"start-line:167 lang:c++\" ><code>\/**\n  Check if the types are criss cross means type1 is MYSQL_TYPE_TIMESTAMP\n  and type2 as MYSQL_TYPE_TIMESTAMP2 or vice versa.\n*\/\ninline bool timestamp_cross_check(enum_field_types type1,\n                                  enum_field_types type2) {\n  return ((type1 == MYSQL_TYPE_TIMESTAMP && type2 == MYSQL_TYPE_TIMESTAMP2) ||\n          (type1 == MYSQL_TYPE_TIMESTAMP2 && type2 == MYSQL_TYPE_TIMESTAMP));\n}<\/code><\/pre>\n<p>\u305d\u3057\u3066\u3001table \u306e compatibility check \u306e\u5f8c\u3001 table id \u3068 table \u306e\u30de\u30c3\u30d4\u30f3\u30b0\u304c\u3055\u308c\u3066<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9733-L9747\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9733-L9747<\/a><\/li>\n<\/ul>\n<p>table_id \u3067\u66f4\u65b0\u5bfe\u8c61\u306e table \u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9785-L9786\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9785-L9786<\/a><\/li>\n<\/ul>\n<pre class=\"start-line:9785 lang:c++\" ><code>  table = m_table =\n      const_cast<Relay_log_info *>(rli)->m_table_map.get_table(m_table_id);<\/code><\/pre>\n<p><a href=\"https:\/\/labs.gree.jp\/blog\/2019\/10\/19616\/\">\u30c1\u30e7\u30c3\u30c8\u30ef\u30ab\u30eb Row-Based Replication\u30fb\u305d\u306e\uff11<\/a> \u306e show binlog events \u306e\u51fa\u529b\u7d50\u679c\u3092\u898b\u308b\u3068\u308f\u304b\u308a\u307e\u3059\u304c\u3001 UPDATE_ROWS_EVENT \u306a\u3069\u306e ROWS EVENT \u306f\u3001 table \u3092\u540d\u524d\u3067\u306f\u306a\u304f\u3001 TABLE_MAP_EVENT \u3067\u5272\u308a\u5f53\u3066\u305f table_id \u6307\u5b9a\u3067\u66f4\u65b0\u3059\u308b\u3088\u3046\u3067\u3059\u3002\u3067\u3001UPDATE_ROWS_EVENT \u306a\u3069\u306f\u307e\u305a \u305d\u306e table_id \u3067\u66f4\u65b0\u5bfe\u8c61\u306e table \u3092\u53c2\u7167\u3057\u3066\u3044\u308b\u3001\u3068\u3002<\/p>\n<p>\u305d\u306e\u3042\u3068\u30019799\u884c\u76ee\u304b\u3089 10074\u884c\u76ee\u306b\u304b\u3051\u3066\u3001UPDATE_ROWS_EVENT \u306a\u3069\u306e ROWS EVENT \u304c\u51e6\u7406\u3055\u308c\u308b\u3093\u3067\u3059\u304c\u3001\u3053\u308c\u307e\u305f\u9577\u3044\u3067\u3059<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9799-L10074\">https:\/\/github.com\/mysql\/mysql-server\/blob\/mysql-8.0.12\/sql\/log_event.cc#L9799-L10074<\/a><\/li>\n<\/ul>\n<p>\u307e\u305a\u306f (rli)->m_table_map.get_table(m_table_id) \u3067 NULL \u304c\u8fd4\u3063\u3066\u304d\u305f\u5834\u5408\u3001 replication filter \u3067\u66f4\u65b0\u5bfe\u8c61\u304b\u3089\u5916\u3055\u308c\u305f\u3063\u3066\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"start-line:9799 lang:c++\" ><code>  if (table) {\n    \/*\n      table == NULL means that this table should not be replicated\n      (this was set up by Table_map_log_event::do_apply_event()\n      which tested replicate-* rules).\n    *\/<\/code><\/pre>\n<h3>Column\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u306a\u3069\u306b\u95a2\u3059\u308b\u88dc\u8db3<\/h3>\n<p>binlog_format=ROW \u304b\u3064 binlog_row_image=FULL \u306e\u5834\u5408\u3001\u66f4\u65b0\u524d\u3068\u66f4\u65b0\u5f8c\u306e\u884c\u306e\u30c7\u30fc\u30bf\u304c\u3059\u3079\u3066\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001 binlog \u306f Change data capture \u306e\u7528\u9014\u306b\u3082\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u305d\u3046\u306a\u308f\u3051\u3067\u3059\uff08\u308f\u305f\u3057\u306f Change data capture \u306b\u758e\u3044\u3067\u3059\u304c)\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u5c45\u4f4f\u5730\u306e\u60c5\u5831\u3092\u5ca1\u5c71\u770c\u304b\u3089\u8328\u57ce\u770c\u306b\u66f8\u304d\u63db\u3048\u308b\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304c\u3042\u3063\u305f\u5834\u5408\u3001binlog_format=STATEMENT\u3067\u306f\u3001\u300c\u8328\u57ce\u770c\u306b\u66f8\u304d\u63db\u308f\u3063\u305f\u300d\u3068\u3044\u3046\u3053\u3068\u3057\u304b\u308f\u304b\u3089\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001 binlog_format=ROW \u304b\u3064 binlog_row_image=FULL \u3060\u3063\u305f\u5834\u5408\u3001\u300c\u5ca1\u5c71\u770c\u304b\u3089\u8328\u57ce\u770c\u306b\u66f8\u304d\u63db\u308f\u3063\u305f\u300d\u3068\u3044\u3046\u3053\u3068\u307e\u3067\u3001binlog\u3092\u8aad\u3093\u3060\u3060\u3051\u3067\u78ba\u5b9f\u306b\u308f\u304b\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001 binlog \u3092 capture \u3059\u308b\u305f\u3081\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306f\u53e4\u304f\u304b\u3089\u958b\u767a\u3055\u308c\u3066\u304a\u308a\u3001\u4f8b\u3048\u3070 <a href=\"https:\/\/github.com\/uber\/storagetapper\">uber\/storagetapper<\/a> \u3068\u3044\u3063\u305f\u3082\u306e\u3082\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>MySQL8.0 \u3067\u306f\u3001 <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/replication-options-binary-log.html#sysvar_binlog_row_metadata\">binlog_row_metadata<\/a>\u3068\u3044\u3046\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u8ffd\u52a0\u3055\u308c\u3066\u304a\u308a\u3001\u3055\u3089\u306b\u8a73\u7d30\u306aColumn\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u8a73\u3057\u304f\u306f\u3001\u4ee5\u4e0b\u306e MySQL High Availability \u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/dev.mysql.com\/blog-archive\/more-metadata-is-written-into-binary-log\/\">More Metadata Is Written Into Binary Log<\/a><\/p>\n<p>Column \u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u3092 binlog \u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u3055\u3089\u306b binlog \u306e\u4f7f\u3044\u52dd\u624b\u304c\u826f\u304f\u306a\u3063\u3066\u3044\u304d\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n<h2>\u7d42\u308f\u308a<\/h2>\n<p><a href=\"https:\/\/www.slideshare.net\/takanorisejima\/mysql-170796099\/51\">\u3053\u3061\u3089\u306e\u306e\u30b9\u30e9\u30a4\u30c9<\/a>\u3067\u8a00\u53ca\u3057\u3066\u3044\u305f\u4ee5\u4e0b\u306e\u3053\u3068\u306b\u3064\u3044\u3066\u3001\u3053\u308c\u3067\u3060\u3044\u305f\u3044\u89e6\u308c\u307e\u3057\u305f\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/image.slidesharecdn.com\/mysqlonec2-190911061459\/95\/mysql-51-638.jpg\" alt=\"\u4e8b\u524d\u306b\u8abf\u3079\u305f\u3053\u3068\" \/><\/p>\n<p>\u3042\u3068\u306f\u3001\u4eca\u56de\u306e\u9023\u8f09\u3067\u53d6\u308a\u4e0a\u3052\u305fWorkLog\u3084\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u95a2\u6570\u306a\u3069\u8aad\u307f\u8fbc\u3093\u3067\u3082\u3089\u3046\u3068\u3001\u3088\u308a\u7406\u89e3\u304c\u6df1\u307e\u308b\u3067\u3057\u3087\u3046\u3002\u4f8b\u3048\u3070\u3001RBR\u306b\u304a\u3051\u308bColumn\u306e\u578b\u5909\u63db\u306b\u3064\u3044\u3066\u306f\u3001\u4eca\u56de\u53d6\u308a\u4e0a\u3052\u305f Table_map_log_event \u3084 Rows_log_event \u306f\u53c2\u8003\u306b\u306a\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<a href=\"https:\/\/dev.mysql.com\/worklog\/?sc=&amp;sd=&amp;k=RBR%3A&amp;s=\">RBR\u306b\u95a2\u3059\u308bWorkLog<\/a>\u306f\u307e\u3060\u307e\u3060\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u95a2\u5fc3\u306e\u3042\u308b\u65b9\u306f\u3053\u3061\u3089\u306b\u3082\u76ee\u3092\u901a\u3055\u308c\u308b\u3068\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u7b2c\u4e00\u90e8\u30fb\u5b8c\u3068\u306a\u308a\u307e\u3059\u3002\u6c17\u304c\u5411\u3044\u305f\u3089\u3001\u307e\u305fRBR\u306b\u95a2\u3059\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u8aad\u3093\u3067\u3001\u3064\u3089\u3064\u3089\u3068\u66f8\u304f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u308f\u3002\u305b\u3058\u307e\u3067\u3059\u3002 \u4eca\u56de\u3082 replication \u306e\u8a71\u3092\u3057\u307e\u3059\u3002 \u306f\u3058\u3081\u306b \u7b2c\uff15\u56de\u3067\u3059\u3002 \u4eca\u56de\u306f TABLE_MAP_EVENT \u306b\u95a2\u3059\u308b\u8a71\u3092\u3057\u307e\u3059\u3002 MySQL Internal Manual \u3067\u306f\u3053\u3061\u3089\u306b\u306a\u308a [&hellip;]<\/p>\n","protected":false},"author":137,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[17],"class_list":["post-19898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-info","tag-mysql"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/19898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/users\/137"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=19898"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/19898\/revisions"}],"predecessor-version":[{"id":21465,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/19898\/revisions\/21465"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=19898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=19898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=19898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}