redpanda: false negative produce request on first stage failure
@mmaslankaprv while working on a fix for #2013 I noticed that it looks like when an error occurs in the first stage of handling a produce request, then even if some other partition is handled successfully in the same produce request, the first stage failure masks that and an error is returned to the client. am I reading that behavior correctly?
@BenPope had an example of a really clean rewrite of part of the produce handler that we should do when we need to restructure it to fix this ticket https://github.com/vectorizedio/redpanda/pull/2014#discussion_r685072124
maybe we can use ss::when_all this way we can access individual results for each dispatch phase:
return ss::when_all(dispatched.begin(), dispatched.end())
.then([&octx,
dispatched_promise = std::move(dispatched_promise),
produced = std::move(produced)](
std::vector<ss::future<>> dispatched_resusts) mutable {
...