-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observed a significant delay when we are creating a file on S3 mount point and then checking its existence #1187
Comments
Can someone look into it? |
Hi, thanks for opening the issue. Let me confirm the core of the problem. Is that right, that you're expecting to detect the existence of the file in the beginning of the second thread with The output that you provide for the script is expected. The existence check with Is there a reason not to catch the |
@vladem Thanks for confirming it. Yes, we can catch the |
There's no Mountpoint config parameter to remove this issue entirely where there are multiple writes trying to open the same file, this is simply caused by the higher latency for metadata operations when talking to S3 when compared to other file system offerings. You could consider enabling metadata caching in Mountpoint which could reduce latencies for metadata lookups, however you should be aware of potential downsides which depend on your use case. You can learn more about metadata caching here: https://github.com/awslabs/mountpoint-s3/blob/main/doc/CONFIGURATION.md#caching-configuration |
As a further point to Vlad's suggestion on how to avoid the issue, you can use the For example, we might redefine the function as follows: def test_file_creation_thread_ops(test_file, count):
try:
with open(test_file, 'xb') as f:
f.write(data)
except FileExistsError:
print(f"File {test_file} already exist for {count}!") If you want to exit from the current block if the file cannot be created, we'd recommend using this. |
Mountpoint for Amazon S3 version
mount-s3 1.8.0
AWS Region
us-west-2
Describe the running environment
Running EC2 on Amazon Linux using IAM roles for an S3 bucket. We are using S3 bucket as a mount point with the help of CSI driver 1.8.0.
Kubernetes version (use kubectl version):
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.15",
Driver version:
1.8.1
Mountpoint options
What happened?
This could be related to #1038
We are using AWS S3 storage using the CSI driver. I created a small script that creates a file and writes data into it. We check the existence of this file and then attempt to create and write it.
The same script is working fine with the normal file system and NFS storage, but with AWS S3, we are observing a delay between file creation and its existence.
Please let me know if this delay is expected, or if we can set some parameters to mitigate the delay between a file creating and checking its existence.
Issue is very easy to reporoduce.
Relevant log output
The text was updated successfully, but these errors were encountered: