|
|
|
|
|
by antirez
3489 days ago
|
|
Ok I'll talk ;-) The matter is that currently, if you delete a key, you know that the command returns once the memory is reclaimed. UNLINK is conceptually like DEL, but the memory reclaiming, while fast because there is a thread doing only like that, is asynchronous. So in certain use cases, while semantically identical if you think at what happens to data, the two commands are semantically different in the way memory is reclaimed. Think at this: 1. CREATE A HUGE KEY. 2. DEL it 3. CREATE A HUGE KEY. 4. DEL it In steps 2 and 4 we know that we always reclaim the memory if we use DEL, so step 3 is never going to use more memory than it was used in step 1. Instead change this with UNLINK. Potentially UNLINK is still freeing memory as we now create back the key again, technically using more memory than the previous peak memory. This in practice is hard to trigger since asynchronous deleting is faster than the time it gets you to build new sizable data. But I still thought this was an important difference that deserved a different command name. |
|
Otherwise people will assume something a lot worse is going on given how you phrased it.