moqui / mantle-usl

Mantle Universal Service Library
http://www.moqui.org/mantle.html
Other
29 stars 61 forks source link

moqui-elasticsearch is inefficient deleting documents(can't create this issue on that component) #184

Closed eigood closed 2 years ago

eigood commented 2 years ago

I've just reset my cluster, and it loaded a copy of sanitized production data. At startup, this created an order, which then had 2800(or so, some super large number) of OrderItemWorkEffort. The following code then is running, and running, and running, doing the same delete call into elasticsearch.

It would seem to be more efficient to just do 1 delete call.

19:26:50.721  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:50.824  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:50.933  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:51.045  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:51.711  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:51.868  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:52.008  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:52.120  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:52.367  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:52.517  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:52.676  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:52.968  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:53.059  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:53.187  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:53.277  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:53.360  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:53.433  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:53.507  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:53.578  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:53.658  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:53.766  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:53.882  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:53.993  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:54.128  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:54.253  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
19:26:54.407  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_sales_order_item with ID 101275::02
19:26:54.501  WARN oquiWorker-9          o.moqui.i.c.ElasticFacadeImpl In delete document not found in index mantle_inventory_order_item with ID 101275::02
eigood commented 2 years ago

It took 23 minutes for this process to complete, against 570 OrderItemWorkEffort. This might help as well:

kubectl logs -n moqui moqui-74fd454f44-kxhzt|grep 'In delete document not found in index mantle_sales_order_item'|wc
   6109   91635  977440
kubectl logs -n moqui moqui-74fd454f44-kxhzt|grep 'In delete document not found in index mantle_inventory_order_item'|wc
   6109   91635 1001876
eigood commented 2 years ago

It might not be OrderItemWorkEffort; at a guess, it's deleting everthing in elasticsearch that is connected to the user who this order is placed for, and this particular account is very busy. I might need help to track this down.

eigood commented 2 years ago

Closing this, to continue in moqui-framework.