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

Adjustments - Use explicit Row level deleted when computing taxes #38

Open
wants to merge 1 commit into
base: 2-2-stable-healthwave
Choose a base branch
from

Commits on Apr 24, 2018

  1. Adjustments - Use explicit Row level deleted when computing taxes

    Tax computation occurs repeatedly per order, per line item, per step during checkout.
    Spree::TaxRate computes new Adjustments after deleting the old ones.
    
    A PR in Solidus pointed out that using `delete_all` can result in generated SQL that
    contains polymorphic columns and caused INNODB to take gap locks. Under load this can result
    in deadlock.
    
    Using `deleted_all` means only primary key based deleted will occur. No gap locks so deadlocks can be
    less likely.
    
    spree_adjustments is a high traffic table. Spree::Adjustment has no `after_destroy` or relations that would invoke logic on destroy so this should be safe.
    
    Ref: solidusio/solidus#127
    glongman committed Apr 24, 2018
    Configuration menu
    Copy the full SHA
    e7533ff View commit details
    Browse the repository at this point in the history