The invention relates to a system and method for managing data in a memory. Provided are a computer program product, system, and method for handling failure of a command to add a record to a log. The log has records at log addresses. Each record in the log includes a key and value and the log addresses map to physical addresses in the storage. A first command for a key and value pair for a record at a specified log address in the log to add to a selected log address in the log is sent. A second command for the key and value pair for the record at the specified log address with a resend parameter set is sent in response to not receiving the selected log address. In response to receiving the second command with the resend parameter set, the log is scanned to determine a log address having the key and value pair. The determined log address is returned.