-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
Issue 359 support scaleway #577
Issue 359 support scaleway #577
Conversation
a071399
to
11e401b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, glad you tracked this subtle problem down. I see other uses of versionId
such as in the head()
method, does the MinIO client do a cast to string in statObject
?
My comments are all bureaucratic in nature, nothing of substance.
11e401b
to
48e5f64
Compare
Thanks a lot @paulfitz for this valuable remark! 🙏 I checked the type of And that's strange that in these case, I realized that it might not be a bug of Grist but instead a minio-js inconsistency:
Therefore, I tend to think it's a bug in minio-js. We may keep the current patch as provided (maybe change the comment), but I would send a patch to the MinIO client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @fflorent
It don't know if I'd classify it as a bug exactly, I think I remember AWS S3 docs being a little vague on when exactly VersionId is included in results, and needing to probe them empirically. Still, bug or not, to be a good drop-in S3 replacement, making a patch to clean up this corner of the MinIO client (when used with Scaleway) would be helpful. |
Done :) : https://github.com/minio/minio-js/pull/1193/files I am changing some comments and test descriptions of the PR to reflect that. |
While MinIO and AWS return versionId as strings, other S3 API implementations return versionId as integers. We must carefully convert the versionId as string in order to cover these various behaviors. Also ensure that docStorage is initialized before attempting to calculate the data size in order to avoid an exception.
Introduced some unit tests to : - ensure listObjects is called with the right arguments; - cover the case when a S3 bucket implementation does not return the versionId as a string but rather as an integer (like Scaleway): in such a case, ensure that the returned snapshotId is a string; - cover the case when the listObjects function emits an error, ensure the versions() call rejets with the error emitted; - that the deleteMarkers are only returned when the includeDeleteMarkers is passed;
48e5f64
to
56288f6
Compare
Great! Thanks a lot @fflorent. |
Context
ANCT Données et Territoire deploys Grist instances whose external storage are S3 and use the Minio connector. The S3 provider used is not MinIO but Scaleway.
Despite having enabled the versioning feature of the bucket, the snapshots feature had erratic behavior and mostly failed to work when importing documents.
The reason appears to be quite simple: that's because the
versionId
returned by Scaleway's API is not a string (as MinIO and AWS do), but is an integer.Steps to reproduce
NB: Scaleway provides Free buckets with a limitation of 75Gb of storage.
.grist
format;GRIST_DOCS_MINIO_*
) so it uses Scaleway bucket and some Redis instance;You get this kind of error message:
And this exception:
The solution
I just cast the versionId to a string
Unit tests
I added some unit tests to cover most of the cases that could occur while using the
versions()
function.Misc
I also fixed this error which occurred while Grist was waiting a long time for response from the S3 storage: