When running various tools on Kubernetes, output is buffered by default which makes debugging a bit problematic.
For example, pt-archiver:
First timestamp is created by Kubernetes, 2nd by pt-archiver. It took around 6 minutes to see output, even though the tool was running and doing work. In a customer case we saw 10+ minutes delay before "kubectl logs" would show output.
Adding STDOUT->autoflush(1); somewhere before progress output should fix it.
Example above was from pt-archiver, but same would apply to pt-online-schema-change etc.
It would be great to have an option like --buffered-output which could either default to ON to keep old behavior, or OFF to always have unbuffered output. Performance boost of buffering stdout/stderr is probably negligible.
When running various tools on Kubernetes, output is buffered by default which makes debugging a bit problematic.
For example, pt-archiver:
First timestamp is created by Kubernetes, 2nd by pt-archiver. It took around 6 minutes to see output, even though the tool was running and doing work. In a customer case we saw 10+ minutes delay before "kubectl logs" would show output.
Adding STDOUT->autoflush(1); somewhere before progress output should fix it.
Example above was from pt-archiver, but same would apply to pt-online-schema-change etc.
It would be great to have an option like --buffered-output which could either default to ON to keep old behavior, or OFF to always have unbuffered output. Performance boost of buffering stdout/stderr is probably negligible.