Problem removing IPs from redis
Issue
There is an apparent problem removing IPs from the redis cache when there are a lot of them.
Debugging
In /galileo_search/app/services/ip_lookup_service.rb
, I put breakpoints in delete_ip_ranges
.
I edited the uga1
inst record turning off IP Authentication
.
When I saved the record and let the ip_ranges
loop finish, ip_keys
contained 1,058,183 keys.
When I let it go on to Redis.current.del ip_keys
, it stopped at this exception:
More debugging
Kevin upped the logging on staging and saw a lot of Protocol error (invalid mbulk count)
He did the math and this would limit us to 1,048,576 keys. So 1,058,183 is just over that.
Possible solution
Maybe just loop through ip_keys
and delete 250,000 at a time.
Edited by Brad Baxter