Bug #91864 Group_member_info::conflict_detection_enable is always OFF in multi master mode
Submitted: 2 Aug 2018 8:17 Modified: 6 Sep 2018 10:04
Reporter: Zhenghu Wen (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:5.7.23 OS:Any
Assigned to: CPU Architecture:Any

[2 Aug 2018 8:17] Zhenghu Wen
Description:
in Group_member_info constructor conflict_detection_enable is set to off even when single_primary_mode_var is off, and there are no place to update conflict_detection_enable to on;

while when single_primary_mode_var is on, Group_member_info::conflict_detection_enable can be updated by Certifier::enable_conflict_detection() or Certifier::disable_conflict_detection() during distributed recovery procedure

How to repeat:
code review

Suggested fix:
Group_member_info::conflict_detection_enable should be re-init in Certifier::Certifier()

for example, like that:

  if (conflict_detection_enable)
    local_member_info->enable_conflict_detection();
  else
    local_member_info->disable_conflict_detection();
[2 Aug 2018 10:55] MySQL Verification Team
Hello Zhenghu,

Thank you for the report.
I have discussed this internally with GR Dev's and concluded that this is  an expected behavior,  please note that Certifier::enable_conflict_detection() function also sets local_member_info->enable_conflict_detection(); and this was fixed as part of BUG#25256910.

Certifier::Certifier()
 :initialized(false),
  positive_cert(0), negative_cert(0),
  parallel_applier_last_committed_global(1),
  parallel_applier_sequence_number(2),
  certifying_already_applied_transactions(false),
  gtid_assignment_block_size(1),
  gtids_assigned_in_blocks_counter(1),
  conflict_detection_enable(!local_member_info->in_primary_mode())
certifier.cc
============
conflict_detection_enable(!local_member_info->in_primary_mode())

Also, confirmed that we do set conflict_detection temporarily ON during mode switch, this is for certifying intermediate transactions.

regards,
Umesh
[6 Aug 2018 1:36] Zhenghu Wen
Hi, Umesh

multi master mode:
1. in configure_group_member_manager(...), local_member_info::conflict_detection_enable is set to false;
2. in configure_and_start_applier_module(), Certifier::conflict_detection_enable is set to true,but local_member_info::conflict_detection_enable remain false;
3. Certifier::enable_conflict_detection() never called, so local_member_info::conflict_detection_enable always be false.

is it an expected behavior? (indeed, local_member_info::conflict_detection_enable is useless in multi master mode)

-----------------------------------------------------
I have discussed this internally with GR Dev's and concluded that this is  an expected behavior,  please note that Certifier::enable_conflict_detection() function also sets local_member_info->enable_conflict_detection(); and this was fixed as part of BUG#25256910.
---------------
yes, Certifier::enable_conflict_detection() will set local_member_info->enable_conflict_detection(), but in multi master mode Certifier::enable_conflict_detection() had not been called.

Certifier::Certifier()
 :initialized(false),
  positive_cert(0), negative_cert(0),
  parallel_applier_last_committed_global(1),
  parallel_applier_sequence_number(2),
  certifying_already_applied_transactions(false),
  gtid_assignment_block_size(1),
  gtids_assigned_in_blocks_counter(1),
  conflict_detection_enable(!local_member_info->in_primary_mode())
certifier.cc
============
conflict_detection_enable(!local_member_info->in_primary_mode())
-------------------------
conflict_detection_enable(!local_member_info->in_primary_mode()) will set Certifier::conflict_detection_enable, but not Group_member_info::conflict_detection_enable. so it remain false.

regards,
Zhenghu
[7 Aug 2018 8:53] MySQL Verification Team
Thank you, Zhenghu.
Verifying based on internal discussion with GR Dev.

regards,
Umesh
[6 Sep 2018 10:04] David Moss
Posted by developer:
 
Seems to be related to internal code changes, and customer appears to have been informed. Closing without change log entry.