Skip to content

Simultaneous changes that require indexing will collide and MySQL will throw errors #2933

Open
@cmacdonald-au

Description

@cmacdonald-au

Preconditions (*)

  1. Magento2 2.4-develop
  2. Inventory 1.2-develop
  3. 100+ sources
  4. 1000+ items assigned to 50% or more of those sources

Steps to reproduce (*)

  1. With all sources assigned to a stock.
  2. Execute the following scenarios multiple times, simultaneously;
  • Remove a source item assignment
  • Add a source item assignment
  • Change the qty levels for a source item across multiple sources

Expected result (*)

  1. The indexer should manage multiple attempts to update the index seamlessly
  2. Data should become eventually consistent

Actual result (*)

  1. Indexer processing collides in the database;
report.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '-BED-Q-56-67614' for key 'PRIMARY', query was: INSERT  INTO `inventory_stock_3_replica`....
report.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'm2_core.inventory_stock_3_replica' doesn't exist, query was: INSERT  INTO `inventory_stock_3_replica....
  1. Index data is left in an inconsistent/unknown state
  2. System performance is negatively impacted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions