Hi,
from what you describe, what you experience seems to be one of the unwanted side-effects of writing temporary files to local disks before you write them to S3.
This was one of the issues, among many others, that lead us to design a new S3 Sink Connector from scratch.
You may find this connector here:
What you describe above serves as a great example to highlight how depending on ephemeral resources, especially in a containerized environment, is the wrong direction to follow. My suggestion is, instead of trying to patch the above scenario with a complicated and fragile workaround, you should get rid of this dependency on local storage altogether.
A Kafka Connect cluster is deployed exactly to connect Kafka with data sources and data sinks. It's not meant to replace Kafka. Therefore, the way Connectors are designed should allow for a Connect cluster to scale up or down in size, move transparently (e.g. by using an underlying resource manager such as Kubernetes) and operate in a fault tolerant way.
Konstantine