Add support for getting the alignment (stripe size) in bytes for pools that require/support it.
Fixes#739
This commit adds two new API calls to IOContext, one to know if the pool requires alignment and
the second one to get the stripe size in bytes:
RequiresAlignment() (bool, error)
Alignment() (uint64, error)
Signed-off-by: Daniel M. Lambea <dmlambea@tenerife.es>
Don't change the build tags variable to include the -tags option at the
start. It's a bit confusing. Replace it with a function that returns
the option + the tags themselves for use on a go command line.
This fixes the remaining shellcheck errors in entrypoint.sh.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Because the package name should be a proper "list" and is used in
multiple places, take shellcheck's warning to heart and replace it
with a proper bash array. Use a common function for generating said
array.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
For this one single case, it feels like overkill to use an array
or other fancy technique. Just silence shellcheck on this instance.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This change add a new bucket struct field, so we can use rgw.admin.API.GetBucketInfo()
to get a bucket's num_shards.
Format bucket.go.
Signed-off-by: oneto1 <644739768@qq.com>
The librbd API for mirroring-related operations changed substantially between
Nautilus and Octopus. Due to this, go-ceph had previously only implemented
mirroring functionality if built against Octopus client libraries. This patch
implements equivalent functionality for use with Nautilus clients.
Signed-off-by: Sanford Miller <smiller@digitalocean.com>
Updates the Go version of the module with `go mod tidy -go 1.17`,
which also adds some explicit requirements in order to support lazy
module loading.
Signed-off-by: Sven Anderson <sven@redhat.com>
Following the mirroring setup there used to be a file named 'token'
holding the bootstrap token left out in sources. We could instead
provide the token via standard output and display it for any further
debugging purpose.
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
Because we have a finalizer configured for Conn that cleans up Ceph
resources, it's important that we don't let it get GC'd before anything
that depends on it has been cleaned up. Since clients are free to hold a
reference to an IOContext without maintaining a reference to the
underlying Conn, we hold such a Conn reference within the IOContext to
signal this dependency to the Go GC.
Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
:= is not capable of accepting values(for variables) from execution
environment. Therefore replace := with ?= for completeness.
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
We will (most probably) remove non-ptrguard code before the next
release. Let's skip the tests already now, because they double the
likelihood of failing flaky tests.
Signed-off-by: Sven Anderson <sven@redhat.com>
The code causing this issue has been packported to pacific and blocks
the CI. We need to temporarily disable for pacific as well.
Signed-off-by: Sven Anderson <sven@redhat.com>
Ceph version is already available from CEPH_VERSION env variable.
CEPH_TAG on the other hand is only defined to determine the tag for
ceph base image and seems to be unused in the resulting go-ceph
container image.
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
"quincy" is already out which will then make "octopus" EOL very soon.
Therefore default to "pacific" instead.
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
This removes the limit on the max buffer size GetImageNames is willing to pass
to rbd_list2, which is somewhat arbitrary and is too small for large clusters.
GetImageNames will continue to start with a small buffer size and retry with a
larger buffer if rbd_list2 returns ERANGE (just without a cap on the max buffer
size it's willing to go to).
Signed-off-by: Sanford Miller <smiller@digitalocean.com>
In case cloning failed, Ceph Mgr returns an additional attribute in the
response. The "failed" attribute contains an errno (as string?!) and a
description. It is useful for applications using go-ceph to report the
error back to the user.
As the CloneStatus is on the same level as the CloneFailure object in
the response, keeping strictly to the CephFS Mgr API would break
compatibility. Instead, a new CloneStatus.GetFailure() method has been
introduced, returning a CloneFailure type (or nil) object with details
about the failure.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
The latest ceph pacific should include the mgr changes needed to test
the NFS apis. We should be able to treat nfs like a normal preview api.
Signed-off-by: John Mulligan <jmulligan@redhat.com>