You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redi...@googlegroups.com
I've got a redis instance with 8GB of mem and a 7.5GB list that needs deleting. We're running sentinel, with masters and slaves etc.
Log onto master
redis-cli> DEL BIGOLELIST
....20 seconds pass....
Yay! Lots of memory now. But, the delete took so long, sentinel demoted this master to a slave. A bit later, BIGOLELIST replicates over from the new master. Uh-oh.
We'll be able to clean this up by disabling Sentinel, but seems like a bit of an issue.
Jan-Erik Rediger
unread,
Apr 13, 2015, 2:46:52 PM4/13/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You're best bet for now: Don't `DEL` it at once, but trim the list in
smaller part (or pop items off, possibly using a Lua script to avoid
sending all that data across the wire)
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redi...@googlegroups.com, Jan-Erik Rediger
To follow up with this; if you need to have the key *not available* when your "deletion" starts, rename the key. After renaming the key, then do as Jan-Eric suggests and delete chunks at a time. As an example, here is a Python function that will do the rename and will slowly delete the list over time.
import uuid
import time
def delete_long_list(conn, key, ex_sleep=.001):
# get a new unique key name
nk = str(uuid.uuid4())
# rename the key
conn.rename(key, nk)
# remove the first 1k elements until empty
for _ in xrange(0, conn.llen(nk), 1000):
conn.ltrim(nk, 1000, -1)
if ex_sleep > 0:
# give Redis some extra time between passes
time.sleep(ex_sleep)
- Josiah
Thomas Love
unread,
Apr 14, 2015, 3:26:47 AM4/14/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redi...@googlegroups.com
I'd argue the issue lies with your design. You are executing an O(N) command that takes X seconds, but you are considering your server failed after some time < X.
As suggested, you could trim the list, or rename-trim, OR, reconfigure Sentinel to tolerate your 20-second blocks.
LAZYDEL will not come for free and would not imo be the best solution in general anyway.