-
Notifications
You must be signed in to change notification settings - Fork 123
Getting too many surrogate keys #104
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
Comments
@daniel-ifrim On which Magento version is this issue observed? |
@udovicic On Magento EE 2.1.4. Is there already a check in the code on 256 max surrogate keys ? I just don't know if I'm missing it. |
@daniel-ifrim Currently, there are no restrictions on length of the keys. There is a piece of code that shortens the keys so more can fit, but that is it. I will see what can be done about this and will keep you updated |
@udovicic I don't know if I made myself clear. In another case, there are configurable products with many options that can have over 256 simple products attached. Splitting 400 surrogate keys into 2 purge requests (vendor/fastly/magento2/Model/Api.php/Api.php::cleanBySurrogateKey()) with the first one having 256 keys and the second one 134 keys looks ok. The issue with Target Rule is extreme. |
@daniel-ifrim Yes, I understand the issue, no worries. Current state is that all cache tags are bundled into single purge request. So in case you have a 1000 tags to clear, it would be required to send them in smaller batches as they do not fit in the single request. And yes, there needs to be a limit on how many batches as well or someone will spam the service. I will keep you updated. |
Fixed in #133 and part of 1.2.39 release. |
I'm getting this in the logs:
[2017-09-17 18:05:25] report.CRITICAL: Return status 400 {"method":"GET","url":"http:/","invalidateInfo":"https://api.fastly.com/service/ [service_id] /purge"} []
I added a debug message on $responseBody in _purge() function and I see this:
[2017-09-17 18:05:25] report.CRITICAL: HTTP/1.1 400 Bad Request {"status": "fail", "reason": "Batch surrogate key request only supports up to 256 surrogate keys"} {"method":"GET","url":"http:/","invalidateInfo":"https://api.fastly.com/service/ [service_id] /purge"} []
Maybe split the cache tag keys and send consecutive purges with keys sets, each having 250-256 keys ? Or something better ?
The text was updated successfully, but these errors were encountered: