Bug #80502 Data Inconsistency with Truncate session along with INSERT/UPDATE/SELECTsession
Submitted: 25 Feb 2016 2:16 Modified: 24 Sep 2016 19:12
Reporter: Ivan Ma Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S2 (Serious)
Version:0.7 lab, 5.7.14-labs-gr080 OS:Oracle Linux
Assigned to: CPU Architecture:Any

[25 Feb 2016 2:16] Ivan Ma
Description:
The execution sequence is
BEGIN; (Session 1)
   INSERT 1, 
   INSERT 2, 
    <TRUNCATE TABLE on another session (Session 2) with another Member Server>
   INSERT 3,
   INSERT 4,
COMMIT;

Expect Result : the TRUNCATE Table should WAIT for the DML session finished. The End Result is EMPTY data across ALL member servers.

Tested Result : Data Inconsistency between member servers.
Session 1 : EMPTY Data
Session 2 : 4 Rows of data

How to repeat:
The execution sequence is
BEGIN; (Session 1)
   INSERT 1, 
   INSERT 2, 
    <TRUNCATE TABLE on another session (Session 2) with another Member Server>
   INSERT 3,
   INSERT 4,
COMMIT;

Expect Result : the TRUNCATE Table should WAIT for the DML session finished. The End Result is EMPTY data across ALL member servers.

Tested Result : Data Inconsistency between member servers.
Session 1 : EMPTY Data
Session 2 : 4 Rows of data

Suggested fix:
Although Development is based on "DDL concurrency not supported",  the DDL with DML concurrency may also be classified similarity.  

But the silent data error is un-acceptable.

Suggest to fix 
1.  Fix DDL concurrency
or
2. To avoid SILIENT data corruption due to DDL with DML, will there be any way to return error from TRUNCATE or DDL with GROUP Replication.
e.g. to execute TRUNCATE with group replication, application may require to add extra variable setting to get that executed with known consequence.
[11 Aug 2016 9:16] MySQL Verification Team
Hello Ivan Ma,

Thank you for the report.
Verified as described with 5.7.14-labs-gr080.

Thanks,
Umesh
[11 Aug 2016 9:16] MySQL Verification Team
test results

Attachment: 80502.results (application/octet-stream, text), 3.89 KiB.