![]() It might be an effective way of dealing with the problem. If you want to find out what’s blocking the access to a table, you can also review the code of the indexing process. As a result, the load time of the page is increased.Īn even better solution is to move the process of saving search query stats to RAM and periodically (say, once an hour) update them. Remember that each time the process is attempting to access a blocked database table, it waits for a certain period of time (defined by environment variables) for the table to become available. This may in turn increase the time it takes for search results to load. However, it can badly affect the execution time of the query and slow down the database. It shouldn’t affect the stats significantly. One may simply find the exception and ignore the update every time the error occurs. It is possible that the stats of the query typed in the product search are being updated in the catalogsearch_query table, causing the lock exception to be thrown. If you stumbled upon some article and modified the configuration of the database accordingly and yet the problem persists, it is recommended to try reproducing the error by using the script above. Since the module that does re-indexing is totally independent of the Sales module, we can easily find the error, save the product IDs and move re-indexing to a separate process in the background. As we all know by now, if it really does happen, the entire process of saving an order in the database is cut short. It is not uncommon that the PHP process triggered by a user that has just completed the checkout process needs access to the very same tables that are simultaneously being used by the re-indexing process. ![]() It’s the observer of the CatalogInventory module, which at times proceeds to re-index all products previously added to the cart. When the lock error occurs during the checkout process, stack-trace makes it easy to find out what causes the exception to be thrown. If we place the test order within less than 40 seconds, the error information will show up. If everything went as planned, we should be now able to launch the script like this: Then, let’s write a simple script that will block a given database table for a specific period of time. ![]() ![]() For the sake of this tutorial, let’s lower the value down to 20 seconds. The time is defined by two environment variables: innodb_lock_wait_timeout and lock_wait_timeout. When MySQL is unable to save data in the table due to the lock-error occurrence, it waits for a certain period of time for the block to disappear. To reproduce the error, it is required to configure the environment accordingly. Again, the website will take ages to load and eventually return a critical error. The customer may encounter a similar problem also at the time of using the built-in product search. Once it occurs, an email that contains information about the error is sent to the email address of the site’s owner (provided it was configured accordingly beforehand). Not only does the situation greatly impede the overall user experience of the site, but also prevents the order from being saved in the database. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |