-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions and environment
- Magento version 2.4.5-p1
- dev/grid/async_indexing set to
1 - at least 2 existing orders
Steps to reproduce
- Sort
sales_order_gridbyupdated_atoldest first - Delete the first row (so you are deleting the order with the oldest
updated_at - Run the
sales_grid_order_async_insertcron job
I'm aware this is unlikely to happen in real life, but we are unaware of exactly how this state occurred, potentially the cron got killed off before the older order was synced
Expected result
The deleted grid order should get re-created, allowing the order to be viewed in the admin panel sales grid section
Actual result
The deleted grid order does not get re-created, the order cannot be viewed in the admin panel sales grid section, leading admin panel users to believe the order does not exist.
Note: There is no issue if any other order is deleted from sales_order_grid DB table.
Additional information
The sales_order_grid entry doesn't get re-created because it does not match the conditions which trigger this:
sales_orderentry has anupdated_atnewer than the most recentsales_order_gridentry- the
sales_orderentry has a newerupdated_atthan the equivalent entry in thesales_order_grid(this doesn't match because thesales_order_gridentry doesn't exist)
Workaround is to update the sales_order.updated_at to be more recent than the most recent sales_order_grid.updated_at value. This can be tricky as the cron runs every minute, you have to time it correctly and get the value right, as you risk updating it to a value which then stops newer orders getting pulled into the grid
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.