There are a couple of possible causes for TMPFAIL to be returned by the cluster. The most common one is that you are receiving sets faster than the cluster can eject data. Do “temp OOMs” show up in the cluster UI and correlate?

If so, that’s the most likely cause.

The best next step depends on your application logic. Sometimes it’s okay to just drop the operation. Other times you’ll want to add an exponential backoff or something like that. It’s application dependent.