The point of the binlog is to protect against data loss during system failures (power outages, hardware failures, etc). So if there is an error writing to the binlog (say the disk is full), the client must be notified that there was a problem and the data is not safe. The only way to do this in the existing protocol is to return an error message (and delete the job from memory).
A possible counter-argument to this is that beanstalkd should try hard to continue providing service even if the disk fails, thus giving better availability overall. It is entirely possible for beanstalkd to continue operating in memory-only mode in such a situation. However, I think this breaks the contract that a binlog is supposed to uphold, especially because there's no way to notify the client that its job exists in an "unsafe" memory-only condition. I think the proper way to handle high-availability needs is with redundant servers, while individual servers stay honest and fail when appropriate. This honesty policy also preserves atomicity of queue operations -- they either completely succeed or completely fail. So, which error message to return? Possibilities include: 1. INTERNAL_ERROR for all errors 2. OUT_OF_MEMORY for full-disk and INTERNAL_ERROR for other (unexpected) errors 3. invent one or more new responses Strictly speaking, we shouldn't introduce new error messages during 1.x, though well-written clients (which, in this case, includes all libraries ever announced on this mailing list) will do something sensible with any unexpected server response. I'm leaning toward option 2 above, to play it safe. I think it'll be useful for clients to distinguish full-disk from other error conditions. A full disk should be by far the most common error, and it's really the only one a sysadmin has control over. Thoughts? kr --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "beanstalk-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en -~----------~----~----~----~------~----~------~--~---
