Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] See how tests run without UPDATE IGNORE #17005

Closed
wants to merge 1 commit into from

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Apr 7, 2020

Overview

Test removing the update ignore to see what fails.

I came across DELETE FROM civicrm_contact WHERE primary_contact_id = 41372076 as a query involved in a deadlock during a batch merge and felt discomfort about whether this was always safe and also whether we could reduce locking queries in deduping (which this is)

In the first instance I am looking to see if anything tested breaks if I switch back to a safer method

Before

When moving data the codes uses (for example)

UPDATE IGNORE civicrm_contact SET primary_contact_id = 41372076`; DELETE FROM civicrm_contact WHERE primary_contact_id = 41372076

After

UPDATE civicrm_contact SET primary_contact_id = 41372076`;

Technical Details

This code goes back to the start
civicrm/civicrm-svn@b74e4bb

Also from mysql manual :

"UPDATE IGNORE statements, including those having an ORDER BY clause, are flagged as unsafe for statement-based replication. (This is because the order in which the rows are updated determines which rows are ignored.) Such statements produce a warning in the error log when using statement-based mode and are written to the binary log using the row-based format when using MIXED mode. (Bug #11758262, Bug #50439) See Section 17.2.1.3, “Determination of Safe and Unsafe Statements in Binary Logging”, for more information."

ALSO
"UPDATE: With IGNORE, rows for which duplicate-key conflicts occur on a unique key value are not updated. Rows updated to values that would cause data conversion errors are updated to the closest valid values instead."

Comments

@civibot
Copy link

civibot bot commented Apr 7, 2020

(Standard links)

@civibot civibot bot added the master label Apr 7, 2020
@seamuslee001
Copy link
Contributor

Test fails do relate @eileenmcnaughton

This turns out to have been a missing piece from
civicrm#17060 as revealed from
civicrm#17072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants