ceph / go-ceph Goto Github PK
View Code? Open in Web Editor NEWGo bindings for Ceph :octopus: :octopus: :octopus:
License: MIT License
Go bindings for Ceph :octopus: :octopus: :octopus:
License: MIT License
Here is my test code:
func getConnection(monitors, user, key string) (*rados.Conn, error) {
conn, err := rados.NewConnWithUser(user)
if err != nil {
return nil, err
}
args := []string{"--client_mount_timeout", "15", "-m", monitors, "--key", key}
err = conn.ParseCmdLineArgs(args)
if err != nil {
return nil, err
}
err = conn.Connect()
if err != nil {
return nil, err
}
return conn, nil
}
Memory leak occurs when this function is executed frequently with the wrong args
(eg: wrong key). But when the args are correct, there is no memory leak.
So my guess is that there was no cleanup operation after called C.rados_connect
with the wrong args
. I try to change the Shutdown
function(remove the ensure_connected
check) and execute it every time Connect
failed, and the problem was solved.
func (c *Conn) Shutdown() {
- if err := c.ensure_connected(); err != nil {
- return
- }
C.rados_shutdown(c.cluster)
}
I don't know if this is a bug or there is something wrong with my usage.
@noahdesu is it possible to implement the above functionality to do it?
I want to know that if there' s version limit about the dependency(libcephfs-dev librbd-dev librados-dev), I install the go-ceph and run example in ubuntu 16.04 and ubuntu18.04, both not worked.
In ubuntu 16.04, got same issue with #78 , and I find that the libcephfs-dev 12.x.x only available in ubuntu18.04, but in 18.04 got another issue same with #76 .
So I want to ask, is there a dependency version limitation or os limitation?
Could you help me to use go-ceph? I can give more details if you want.
I'm using rbd-docker-plugin and it crashed when calling LockExclusive.
here's my env,
CentOS 7.2 with kernel 4.5.3-1.el7.elrepo.x86_64,
ceph version 10.2.1 (3a66dd4f30852819c1bdaa8ec23c795d4ad77269)
librados2 & librbd1 1:10.2.1-0.el7
I couldn't see any relevant log messages, in dmesg, i see this usually (it didn't crash if the image is already lock and return a error message that says it can't get the exclusive lock)
[499439.546891] libceph: client14394 fsid bdce5816-e19c-4aac-b6e9-c694920dc9e7
[499439.552582] libceph: mon0 10.10.131.54:6789 session established
[499439.569701] rbd: rbd0: added with size 0x500000
[499439.693347] rbd: rbd1: added with size 0x500000
however when it crash, there's no such messages in the dmesg.
btw, the lock is created and locking an image using rdb command directly works fine.
Hi everyone. First of all I want to thank you for this useful package.
When I try to use it with mimic release, I get this error: Operation not supported
. I want to know following things:
In function func (*Image) Clone
and func Create
, there is no param to specific --order
. Both c-cpeh lib and rbd command can do it.
In Go, the "C" package is a special type of package that creates local symbols names (non exportable) to the importing package. The result, in the case of rados.GetRadosError() is that trying to use results in:
cannot use cerr (type C.int) as type rados.C.int in argument to rados.GetRadosError
It seems that "C.int" within 'rados' namespace produces a symbol of the type _Ctype_int
, which given it's first character _
is not exported. As such, we have the type being defined as rados._Ctype_int
, which is not accessible outside of the rados package.
I'm using object storage with 3 OSD and 3 MON.
I implement client to create a IOContext for every pool to handle write and get. But seem it got this error in interval time of 2 to 4 minutes.
terminate called after throwing an instance of 'ceph::buffer::end_of_buffer'
Anyone got the same error ?
Add method TestAndSetXattr and some consts in the ioctx.go
const (
LIBRADOS_CMPXATTR_OP_EQ = 1
LIBRADOS_CMPXATTR_OP_NE = 2
LIBRADOS_CMPXATTR_OP_GT = 3
LIBRADOS_CMPXATTR_OP_GTE = 4
LIBRADOS_CMPXATTR_OP_LT = 5
LIBRADOS_CMPXATTR_OP_LTE = 6
)
func (ioctx *IOContext) TestAndSetXattr(object string, name string, old_data []byte, new_data []byte) error {
c_object := C.CString(object)
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_object))
defer C.free(unsafe.Pointer(c_name))
op := C.rados_create_write_op()
C.rados_write_op_cmpxattr(
op,
c_name,
LIBRADOS_CMPXATTR_OP_EQ,
(*C.char)(unsafe.Pointer(&old_data[0])),
(C.size_t)(len(old_data)))
C.rados_write_op_setxattr(
op,
c_name,
(*C.char)(unsafe.Pointer(&new_data[0])),
(C.size_t)(len(new_data)))
ret := C.rados_write_op_operate(op, ioctx.ioctx, c_object, nil, 0)
C.rados_release_write_op(op)
return GetRadosError(ret)
}
Hi all, if you are ok i could spend a PR on this.
make test
go test -v ./...
# github.com/ceph/go-ceph
package_test.go:4:2: cannot find package "github.com/stretchr/testify/assert" in any of:
/usr/lib64/go/1.9/src/github.com/stretchr/testify/assert (from $GOROOT)
/home/dmaiocchi/go/src/github.com/stretchr/testify/assert (from $GOPATH)
FAIL github.com/ceph/go-ceph [setup failed]
# github.com/ceph/go-ceph/cephfs
package_test.go:4:2: cannot find package "github.com/stretchr/testify/assert" in any of:
/usr/lib64/go/1.9/src/github.com/stretchr/testify/assert (from $GOROOT)
/home/dmaiocchi/go/src/github.com/stretchr/testify/assert (from $GOPATH)
FAIL github.com/ceph/go-ceph/cephfs [setup failed]
# github.com/ceph/go-ceph/rados
rados/rados_test.go:17:2: cannot find package "github.com/gofrs/uuid" in any of:
/usr/lib64/go/1.9/src/github.com/gofrs/uuid (from $GOROOT)
/home/dmaiocchi/go/src/github.com/gofrs/uuid (from $GOPATH)
FAIL github.com/ceph/go-ceph/rados [setup failed]
# github.com/ceph/go-ceph/rbd
package_test.go:4:2: cannot find package "github.com/stretchr/testify/assert" in any of:
/usr/lib64/go/1.9/src/github.com/stretchr/testify/assert (from $GOROOT)
/home/dmaiocchi/go/src/github.com/stretchr/testify/assert (from $GOPATH)
FAIL github.com/ceph/go-ceph/rbd [setup failed]
I am having some difficulty dealing with propogating deadlines and handling timeouts (due to unhealthy cluster etc) at the application level. It would be great if there was a rados API that took a go context
as the first parameter so that operations can express deadlines and do cancellations more cleanly.
This issue is a request for comments, I am willing to do the work and do a PR but I am not familiar enough with rados to know if this lines up with how it is used in other languages or if it would be clean to implement. Any suggestions?
I'm trying to make a static binary using go-ceph library.
I have tried passing the static flag to cgo:
go build -ldflags "-extldflags '-static'" cinder_example.go
# command-line-arguments
/home/adrian/.gvm/gos/go1.6.2/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lrados
/usr/bin/ld: cannot find -lrados
/usr/bin/ld: cannot find -lrados
collect2: error: ld returned 1 exit status
Or without cgo:
CGO_ENABLED=0 go build -ldflags '-s' cinder_example.go
# command-line-arguments
./cinder_example.go:8: undefined: rados.NewConn
Is this possible?
Thanks
Go 1.6 introduced a change to CGO with respect to passing pointers of Go allocated memory to C code:
https://golang.org/doc/go1.6#cgo
The relevant portion is:
Go and C may share memory allocated by Go when a pointer to that memory is passed to C as part of a cgo call, provided that the memory itself contains no pointers to Go-allocated memory, and provided that C does not retain the pointer after the call returns. These rules are checked by the runtime during program execution: if the runtime detects a violation, it prints a diagnosis and crashes the program.
I observe the following panic (in the below case with go test
using a 1.6 Go compiler):
-- FAIL: TestMonCommand (0.01s)
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]
panic: runtime error: cgo argument has Go pointer to Go pointer
goroutine 53 [running]:
panic(0x7d87c0, 0xc8204a6160)
/usr/local/go/src/runtime/panic.go:464 +0x3e6
testing.tRunner.func1(0xc8200a0000)
/usr/local/go/src/testing/testing.go:467 +0x192
panic(0x7d87c0, 0xc8204a6160)
/usr/local/go/src/runtime/panic.go:426 +0x4e9
github.com/ceph/go-ceph/rados.(*Conn).MonCommand(0xc820228010, 0xc8200e0024, 0x1f, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/ceph/go-ceph/rados/conn.go:277 +0x3d8
github.com/ceph/go-ceph/rados_test.TestMonCommand(0xc8200a0000)
/go/src/github.com/ceph/go-ceph/rados/rados_test.go:482 +0x2fe
testing.tRunner(0xc8200a0000, 0xc40b98)
/usr/local/go/src/testing/testing.go:473 +0x98
created by testing.RunTests
/usr/local/go/src/testing/testing.go:582 +0x892
FAIL github.com/ceph/go-ceph/rados 32.780s
Hi Noah: I am developing a object storage system using the rados object in ceph by your go-ceph on github. But when I compile my go script ,I get a warning that the function rados_read_op_omap_get_vals in librados.h:3389 is deprecated which is used in your go-ceph/rados/ioctx.go:453.Maybe you should use the rados_read_op_omap_get_vals2 according to librados.h:3395
It is beneficial to add go vet
in Travis to clean up any minor mistakes.
I can't quite determine how to use this method. I'm attempting to test by adding some code to TestParentInfo
after the Clone()
is complete. Near here https://github.com/ceph/go-ceph/blob/master/rbd/rbd_test.go#L210
I'm adding this snippet, which uses the parent/snap names from the call to GetParentInfo()
snapImg := rbd.GetImage(ioctx, pName)
err = snapImg.Open(pSnapname)
assert.NoError(t, err)
pools, images, err := snapImg.ListChildren()
assert.NoError(t, err)
That last assertion fails with err == -ERANGE
It's also worth noting that if I call snapImg.Open()
without specifying the snapName, the test panics with an out-of-range at https://github.com/ceph/go-ceph/blob/master/rbd/rbd.go#L471
I'm not super familiar with the C or C++ versions of librados, so this may be intended behavior but if you attempt to read omap values on a nonexistent object, you get an Input / Output error, not ErrorNotFound:
func TestOmapReturnedError(t *testing.T) {
conn, _ := rados.NewConn()
conn.ReadDefaultConfigFile()
conn.Connect()
ioctx, err := conn.OpenIOContext("mypool")
if err != nil {
panic(err)
}
_, err := ioctx.GetAllOmapValues("def.not.exist", "", "", 100)
if err != rados.RadosErrorNotFound {
t.Fatalf("unexpected error code %v", err)
}
}
And I get: unexpected error code rados: Input/output error
I generally like to treat object not found errors differently from "can't speak to OSD or MON" errors, and Input/output error is a bit vague. If it is not possible to reliable disambiguate the errors and coerce the type with what librados gives us then feel free to close this, but it bugs me.
I want to get information about the location of OSD.
I can get information by executing on the command line "ceph osd find osd.0".
But when I send prefix("osd find osd.0") to this function("monCommand") in golang,the info is not what I want.
Is there a solution?Thanks!
rbd list lockers always cause crashing because of 2 issues.
One is when no locker is on rbd image, c_clients_len, c_cookies_len and c_addrs_len is 0, so the 2nd C.rbd_list_lockers will crash due to out of range error on clients_buf, cookies_buf and addrs_buf.
The other one is c_clients_len doesn't mean the locker number. When there is exclusive lock on rbd image and then filling lockers with clients_buf, cookies_buf and addrs_buf, it will also cause index out of range error.
I am new to ceph, and am looking at this library to list image information in a dashboard.
How do I get the equivalent of rbd du myrbd
or rbd diff myrbd | awk '{ SUM += $2 } END { print SUM/1024/1024 " MB" }'
cli command? the Size
in rbd.ImageInfo
is the total allocated size.
My code so far: https://gist.github.com/sajal/4e7e0bd77d3deced0d450e8f9af7775a
Hi there, I'm wondering if there are any parameters or some other ways that can control the rados connection timeout.
For example, when I set the wrong monitor address in args, conn.Connect()
takes 5 minutes to time out, it's too long.
I tried --connect-timeout
, but it doesn't work
conn, err := rados.NewConnWithUser(user)
...
args := []string{"--connect-timeout", "10", ...}
conn.ParseCmdLineArgs(args)
conn.Connect()
go get github.com/ceph/go-ceph
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSMessage_ContentLevel' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSDigestContext_Update'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PORT_SetError' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSSignerInfo_GetSignerCommonName'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PK11_CipherOp' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSDecoder_Start'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSSignedData_VerifySignerInfo' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSSignedData_ImportCerts'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PORT_Free' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
PK11_ParamFromIV'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PK11_FreeSlot' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
CERT_GetDefaultCertDB'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_ShutdownContext' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
PK11_CreateContextBySymKey'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PK11_DestroyContext' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
PK11_ImportSymKey'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSDecoder_Update' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
PK11_FreeSymKey'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSSignedData_GetSignerInfo' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSSignedData_HasDigests'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PORT_NewArena' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSContentInfo_GetContentTypeTag'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSMessage_Destroy' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_InitContext'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSSignedData_VerifyCertsOnly' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSMessage_ContentLevelCount'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSContentInfo_GetContent' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSDigestContext_FinishMultiple'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSDecoder_Cancel' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSSignerInfo_GetVerificationStatus'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PK11_DigestFinal' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSDigestContext_StartMultiple'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSUtil_VerificationStatusToString' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSSignedData_SetDigests'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PR_GetError' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSMessage_GetContent'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to PORT_FreeArena' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
NSS_CMSSignedData_SignerInfoCount'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to SECITEM_FreeItem' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
PK11_GetBestSlot'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to NSS_CMSDecoder_Finish' /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to
SECMOD_RestartModules'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librbd.so: undefined reference to `NSS_CMSSignedData_GetDigestAlgs'
collect2: error: ld returned 1 exit status
It looks like travis-ci is not receiving push notifications for ceph/go-ceph repository. I don't have admin access to the settings, so I can't investigate. @theanalyst do you have access to the settings on this repository?
Currently, travis ci is configured to test with luminous and mimic. The test matrix should be extended to include nautilus as well.
rbd.Image.ReadAt()
and rbd.image.WriteAt()
are not thread-safe (i.e. cannot safely be used from more than one go-routine) because they call rbd.image.Seek()
without maintaing a mutex. The reason POSIX introduced (and golang simulates) ReadAt
and WriteAt
calls was specifically so that they can be used safely in a multithreaded environment.
I don't know whether librbd
supports proper ReadAt
and WriteAt
calls. If it does then these should be used. If it does not then at the very least the documentation should carry a heavy warning that unlike ReadAt()
and WriteAt()
elsewhere in golang, these are not concurrency safe.
This is actually causing me a problem in gonbdserver, where I attempt to use a threaded backend to ensure that reads/writes to different OSDs execute in parallel. With the existing implementation, this is very unsafe.
Tasks:
Fix golint
make check
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/doc.go:1:1: package comment should be of the form "Package rados ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/doc.go:7:2: a blank import should be only in a main or test package, or have a comment justifying it
Found 2 lint suggestions; failing.
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:15:2: don't use underscores in Go names; struct field Kb_used should be KbUsed
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:16:2: don't use underscores in Go names; struct field Kb_avail should be KbAvail
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:17:2: don't use underscores in Go names; struct field Num_objects should be NumObjects
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:28:2: don't use underscores in Go names; var c_id should be cID
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:40:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:66:2: don't use underscores in Go names; var c_path should be cPath
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:71:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:82:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:87:1: exported method Conn.OpenIOContext should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:88:2: don't use underscores in Go names; var c_pool should be cPool
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:94:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:129:2: don't use underscores in Go names; var c_opt should be cOpt
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:129:9: don't use underscores in Go names; var c_val should be cVal
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:135:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:144:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:154:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:165:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:170:16: don't use underscores in Go names; method ensure_connected should be ensureConnected
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:173:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:178:1: comment on exported method Conn.GetClusterStats should be of the form "GetClusterStats ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:184:2: don't use underscores in Go names; var c_stat should be cStat
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:188:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:217:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:228:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:243:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:257:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:262:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:273:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:278:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/conn.go:288:1: comment on exported method Conn.MonCommandWithInputBuffer should be of the form "MonCommandWithInputBuffer ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/doc.go:1:1: package comment should be of the form "Package rados ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:36:2: don't use underscores in Go names; struct field Num_bytes should be NumBytes
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:38:2: don't use underscores in Go names; struct field Num_kb should be NumKb
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:40:2: don't use underscores in Go names; struct field Num_objects should be NumObjects
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:42:2: don't use underscores in Go names; struct field Num_object_clones should be NumObjectClones
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:44:2: don't use underscores in Go names; struct field Num_object_copies should be NumObjectCopies
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:45:2: don't use underscores in Go names; struct field Num_objects_missing_on_primary should be NumObjectsMissingOnPrimary
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:47:2: don't use underscores in Go names; struct field Num_objects_unfound should be NumObjectsUnfound
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:50:2: don't use underscores in Go names; struct field Num_objects_degraded should be NumObjectsDegraded
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:51:2: don't use underscores in Go names; struct field Num_rd should be NumRd
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:52:2: don't use underscores in Go names; struct field Num_rd_kb should be NumRdKb
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:53:2: don't use underscores in Go names; struct field Num_wr should be NumWr
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:54:2: don't use underscores in Go names; struct field Num_wr_kb should be NumWrKb
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:88:6: don't use underscores in Go names; var c_ns should be cNs
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:99:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:119:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:132:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:144:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:161:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:168:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:179:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:192:1: comment on exported method IOContext.GetPoolStats should be of the form "GetPoolStats ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:195:2: don't use underscores in Go names; var c_stat should be cStat
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:199:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:252:7: don't use underscores in Go names; var c_entry should be cEntry
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:265:6: don't use underscores in Go names; var c_psize should be cPsize
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:266:6: don't use underscores in Go names; var c_pmtime should be cPmtime
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:267:2: don't use underscores in Go names; var c_object should be cObject
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:278:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:289:2: don't use underscores in Go names; var c_object should be cObject
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:290:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:303:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:308:1: comment on exported method IOContext.SetXattr should be of the form "SetXattr ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:310:2: don't use underscores in Go names; var c_object should be cObject
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:311:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:325:1: comment on exported method IOContext.ListXattrs should be of the form "ListXattrs ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:329:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:341:7: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:341:15: don't use underscores in Go names; var c_val should be cVal
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:342:7: don't use underscores in Go names; var c_len should be cLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:359:1: comment on exported method IOContext.RmXattr should be of the form "RmXattr ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:361:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:362:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:374:1: comment on exported method IOContext.SetOmap should be of the form "SetOmap ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:376:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:383:2: don't use underscores in Go names; var c_keys should be cKeys
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:384:2: don't use underscores in Go names; var c_values should be cValues
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:385:2: don't use underscores in Go names; var c_lengths should be cLengths
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:394:3: don't use underscores in Go names; var c_key_ptr should be cKeyPtr
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:399:3: don't use underscores in Go names; var c_value_ptr should be cValuePtr
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:401:7: don't use underscores in Go names; var c_length should be cLength
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:410:3: don't use underscores in Go names; var c_length_ptr should be cLengthPtr
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:434:1: comment on exported method IOContext.ListOmapValues should be of the form "ListOmapValues ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:440:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:441:2: don't use underscores in Go names; var c_start_after should be cStartAfter
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:442:2: don't use underscores in Go names; var c_filter_prefix should be cFilterPrefix
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:443:2: don't use underscores in Go names; var c_max_return should be cMaxReturn
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:451:6: don't use underscores in Go names; var c_iter should be cIter
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:452:6: don't use underscores in Go names; var c_prval should be cPrval
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:472:7: don't use underscores in Go names; var c_key should be cKey
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:473:7: don't use underscores in Go names; var c_val should be cVal
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:474:7: don't use underscores in Go names; var c_len should be cLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:495:1: comment on exported method IOContext.GetOmapValues should be of the form "GetOmapValues ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:512:1: comment on exported method IOContext.GetAllOmapValues should be of the form "GetAllOmapValues ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:544:1: comment on exported method IOContext.RmOmapKeys should be of the form "RmOmapKeys ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:546:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:552:2: don't use underscores in Go names; var c_keys should be cKeys
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:557:3: don't use underscores in Go names; var c_key_ptr should be cKeyPtr
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:575:1: comment on exported method IOContext.CleanOmap should be of the form "CleanOmap ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:577:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:589:6: exported type Iter should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:596:6: exported type IterToken should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:598:1: comment on exported method IOContext.Iter should be of the form "Iter ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:607:1: comment on exported method Iter.Token should be of the form "Token ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:612:1: exported method Iter.Seek should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:631:6: don't use underscores in Go names; var c_entry should be cEntry
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:632:6: don't use underscores in Go names; var c_namespace should be cNamespace
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:642:1: comment on exported method Iter.Value should be of the form "Value ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:650:1: comment on exported method Iter.Namespace should be of the form "Namespace ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:658:1: comment on exported method Iter.Err should be of the form "Err ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:666:1: comment on exported method Iter.Close should be of the form "Close ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:672:1: comment on exported method IOContext.LockExclusive should be of the form "LockExclusive ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:674:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:675:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:676:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:677:2: don't use underscores in Go names; var c_desc should be cDesc
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:679:6: don't use underscores in Go names; var c_duration should be cDuration
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:685:6: don't use underscores in Go names; var c_flags should be cFlags
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:720:1: comment on exported method IOContext.LockShared should be of the form "LockShared ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:722:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:723:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:724:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:725:2: don't use underscores in Go names; var c_tag should be cTag
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:726:2: don't use underscores in Go names; var c_desc should be cDesc
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:728:6: don't use underscores in Go names; var c_duration should be cDuration
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:734:6: don't use underscores in Go names; var c_flags should be cFlags
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:771:1: comment on exported method IOContext.Unlock should be of the form "Unlock ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:773:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:774:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:775:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:800:1: comment on exported method IOContext.ListLockers should be of the form "ListLockers ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:804:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:805:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:807:2: don't use underscores in Go names; var c_tag should be cTag
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:808:2: don't use underscores in Go names; var c_clients should be cClients
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:809:2: don't use underscores in Go names; var c_cookies should be cCookies
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:810:2: don't use underscores in Go names; var c_addrs should be cAddrs
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:812:6: don't use underscores in Go names; var c_exclusive should be cExclusive
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:813:2: don't use underscores in Go names; var c_tag_len should be cTagLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:814:2: don't use underscores in Go names; var c_clients_len should be cClientsLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:815:2: don't use underscores in Go names; var c_cookies_len should be cCookiesLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:816:2: don't use underscores in Go names; var c_addrs_len should be cAddrsLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:852:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:857:1: comment on exported method IOContext.BreakLock should be of the form "BreakLock ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:859:2: don't use underscores in Go names; var c_oid should be cOid
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:860:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:861:2: don't use underscores in Go names; var c_client should be cClient
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/ioctx.go:862:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:14:6: exported type RadosError should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:14:6: type name will be used as rados.RadosError by other packages, and that stutters; consider calling this Error
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:20:5: exported var RadosAllNamespaces should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:22:5: exported var RadosErrorNotFound should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:23:5: exported var RadosErrorPermissionDenied should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:25:1: exported function GetRadosError should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:35:6: don't use underscores in Go names; var c_major should be cMajor
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:35:15: don't use underscores in Go names; var c_minor should be cMinor
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:35:24: don't use underscores in Go names; var c_patch should be cPatch
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:50:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:64:2: don't use underscores in Go names; var c_user should be cUser
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:72:2: don't use underscores in Go names; var c_cluster_name should be cClusterName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:75:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rados/rados.go:82:9: if block ends with a return statement, so drop this else and outdent its block
Found 162 lint suggestions; failing.
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/doc.go:1:1: package comment should be of the form "Package rbd ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:22:2: comment on exported const RbdFeatureLayering should be of the form "RbdFeatureLayering ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:24:2: exported const RbdFeatureStripingV2 should have comment (or a comment on this block) or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:34:2: comment on exported const RbdFeaturesIncompatible should be of the form "RbdFeaturesIncompatible ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:38:2: comment on exported const RbdFeaturesRwIncompatible should be of the form "RbdFeaturesRwIncompatible ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:41:2: comment on exported const RbdFeaturesMutable should be of the form "RbdFeaturesMutable ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:44:2: comment on exported const RbdFeaturesSingleClient should be of the form "RbdFeaturesSingleClient ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:48:1: comment on exported type RBDError should be of the form "RBDError ..." (with optional leading article)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:49:6: type name will be used as rbd.RBDError by other packages, and that stutters; consider calling this Error
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:52:2: error var RbdErrorImageNotOpen should have name of the form ErrFoo
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:52:2: exported var RbdErrorImageNotOpen should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:53:2: error var RbdErrorNotFound should have name of the form ErrFoo
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:56:1: comment on exported type ImageInfo should be of the form "ImageInfo ..." (with optional leading article)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:59:2: don't use underscores in Go names; struct field Obj_size should be ObjSize
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:60:2: don't use underscores in Go names; struct field Num_objs should be NumObjs
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:62:2: don't use underscores in Go names; struct field Block_name_prefix should be BlockNamePrefix
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:63:2: don't use underscores in Go names; struct field Parent_pool should be ParentPool
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:64:2: don't use underscores in Go names; struct field Parent_name should be ParentName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:67:1: comment on exported type SnapInfo should be of the form "SnapInfo ..." (with optional leading article)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:69:2: struct field Id should be ID
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:74:1: comment on exported type Locker should be of the form "Locker ..." (with optional leading article)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:81:1: comment on exported type Image should be of the form "Image ..." (with optional leading article)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:94:1: comment on exported type Snapshot should be of the form "Snapshot ..." (with optional leading article)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:102:2: struct field Id should be ID
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:113:4: don't use underscores in Go names; var go_s should be goS
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:125:1: comment on exported function GetError should be of the form "GetError ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:132:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:137:1: comment on exported function Version should be of the form "Version ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:139:6: don't use underscores in Go names; var c_major should be cMajor
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:139:15: don't use underscores in Go names; var c_minor should be cMinor
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:139:24: don't use underscores in Go names; var c_patch should be cPatch
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:168:1: comment on exported function GetImage should be of the form "GetImage ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:176:1: comment on exported function Create should be of the form "Create ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:186:2: don't use underscores in Go names; var c_order should be cOrder
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:187:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:218:1: comment on exported method Image.Clone should be of the form "Clone ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:225:44: don't use underscores in Go names; method parameter c_ioctx should be cIoctx
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:225:70: don't use underscores in Go names; method parameter c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:226:2: don't use underscores in Go names; var c_order should be cOrder
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:227:2: don't use underscores in Go names; var c_p_name should be cPName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:228:2: don't use underscores in Go names; var c_p_snapname should be cPSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:229:2: don't use underscores in Go names; var c_c_name should be cCName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:249:1: comment on exported method Image.Remove should be of the form "Remove ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:253:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:261:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:268:1: comment on exported method Image.Rename should be of the form "Rename ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:270:2: don't use underscores in Go names; var c_srcname should be cSrcname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:271:2: don't use underscores in Go names; var c_destname should be cDestname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:285:1: comment on exported method Image.Open should be of the form "Open ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:289:6: don't use underscores in Go names; var c_image should be cImage
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:290:6: don't use underscores in Go names; var c_snap_name should be cSnapName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:292:6: don't use underscores in Go names; var read_only should be readOnly
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:294:2: don't use underscores in Go names; var c_name should be cName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:324:1: comment on exported method Image.Close should be of the form "Close ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:338:1: comment on exported method Image.Resize should be of the form "Resize ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:347:1: comment on exported method Image.Stat should be of the form "Stat ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:353:6: don't use underscores in Go names; var c_stat should be cStat
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:369:1: comment on exported method Image.IsOldFormat should be of the form "IsOldFormat ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:370:36: don't use underscores in Go names; method result old_format should be oldFormat
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:375:6: don't use underscores in Go names; var c_old_format should be cOldFormat
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:385:1: comment on exported method Image.GetSize should be of the form "GetSize ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:398:1: comment on exported method Image.GetFeatures should be of the form "GetFeatures ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:411:1: comment on exported method Image.GetStripeUnit should be of the form "GetStripeUnit ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:412:38: don't use underscores in Go names; method result stripe_unit should be stripeUnit
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:424:1: comment on exported method Image.GetStripeCount should be of the form "GetStripeCount ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:425:39: don't use underscores in Go names; method result stripe_count should be stripeCount
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:437:1: comment on exported method Image.GetOverlap should be of the form "GetOverlap ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:450:1: comment on exported method Image.Copy should be of the form "Copy ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:465:4: don't use underscores in Go names; var c_destname should be cDestname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:474:12: should omit type Image from declaration of var dest; it will be inferred from the right-hand side
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:476:11: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:484:1: comment on exported method Image.Flatten should be of the form "Flatten ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:487:10: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:493:1: comment on exported method Image.ListChildren should be of the form "ListChildren ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:500:6: don't use underscores in Go names; var c_pools_len should be cPoolsLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:500:19: don't use underscores in Go names; var c_images_len should be cImagesLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:512:2: don't use underscores in Go names; var pools_buf should be poolsBuf
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:513:2: don't use underscores in Go names; var images_buf should be imagesBuf
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:543:1: comment on exported method Image.ListLockers should be of the form "ListLockers ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:553:6: don't use underscores in Go names; var c_exclusive should be cExclusive
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:554:6: don't use underscores in Go names; var c_tag_len should be cTagLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:554:17: don't use underscores in Go names; var c_clients_len should be cClientsLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:554:32: don't use underscores in Go names; var c_cookies_len should be cCookiesLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:554:47: don't use underscores in Go names; var c_addrs_len should be cAddrsLen
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:555:6: don't use underscores in Go names; var c_locker_cnt should be cLockerCnt
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:571:2: don't use underscores in Go names; var tag_buf should be tagBuf
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:572:2: don't use underscores in Go names; var clients_buf should be clientsBuf
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:573:2: don't use underscores in Go names; var cookies_buf should be cookiesBuf
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:574:2: don't use underscores in Go names; var addrs_buf should be addrsBuf
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:604:1: comment on exported method Image.LockExclusive should be of the form "LockExclusive ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:610:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:616:1: comment on exported method Image.LockShared should be of the form "LockShared ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:622:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:623:2: don't use underscores in Go names; var c_tag should be cTag
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:630:1: comment on exported method Image.Unlock should be of the form "Unlock ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:636:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:642:1: comment on exported method Image.BreakLock should be of the form "BreakLock ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:648:2: don't use underscores in Go names; var c_client should be cClient
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:649:2: don't use underscores in Go names; var c_cookie should be cCookie
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:708:1: exported method Image.Seek should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:726:1: comment on exported method Image.Discard should be of the form "Discard ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:732:1: exported method Image.ReadAt should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:758:1: exported method Image.WriteAt should have comment or be unexported
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:777:1: comment on exported method Image.Flush should be of the form "Flush ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:782:1: comment on exported method Image.GetSnapshotNames should be of the form "GetSnapshotNames ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:789:6: don't use underscores in Go names; var c_max_snaps should be cMaxSnaps
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:793:2: don't use underscores in Go names; var c_snaps should be cSnaps
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:812:1: comment on exported method Image.CreateSnapshot should be of the form "CreateSnapshot ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:818:2: don't use underscores in Go names; var c_snapname should be cSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:832:1: comment on exported method Image.GetSnapshot should be of the form "GetSnapshot ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:840:1: comment on exported method Image.GetParentInfo should be of the form "GetParentInfo ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:843:35: don't use underscores in Go names; method parameter p_pool should be pPool
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:843:43: don't use underscores in Go names; method parameter p_name should be pName
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:843:51: don't use underscores in Go names; method parameter p_snapname should be pSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:854:9: if block ends with a return statement, so drop this else and outdent its block
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:859:1: comment on exported method Snapshot.Remove should be of the form "Remove ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:865:2: don't use underscores in Go names; var c_snapname should be cSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:871:1: comment on exported method Snapshot.Rollback should be of the form "Rollback ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:879:2: don't use underscores in Go names; var c_snapname should be cSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:885:1: comment on exported method Snapshot.Protect should be of the form "Protect ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:891:2: don't use underscores in Go names; var c_snapname should be cSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:897:1: comment on exported method Snapshot.Unprotect should be of the form "Unprotect ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:903:2: don't use underscores in Go names; var c_snapname should be cSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:909:1: comment on exported method Snapshot.IsProtected should be of the form "IsProtected ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:916:6: don't use underscores in Go names; var c_is_protected should be cIsProtected
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:918:2: don't use underscores in Go names; var c_snapname should be cSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:930:1: comment on exported method Snapshot.Set should be of the form "Set ..."
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:936:2: don't use underscores in Go names; var c_snapname should be cSnapname
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:945:6: don't use underscores in Go names; var num_entries should be numEntries
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:952:2: don't use underscores in Go names; var c_entries should be cEntries
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:976:2: don't use underscores in Go names; var c_id should be cID
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:985:2: don't use underscores in Go names; var c_id should be cID
/home/dmaiocchi/go/src/github.com/ceph/go-ceph/rbd/rbd.go:986:2: don't use underscores in Go names; var c_name should be cName
The README.md mentions that I need "the native RADOS library and development headers", but finding the right ones is hard if you're not yourself a ceph developer.
A hint or a pointer to the appropriate docs would help, as you need to know three things:
A nice hint might be
If you get "No such file or directory // #include <rbd/librados.h>", you need to install the native librados and librbd. Chose the newest version of each: eg, librados2", and the -devel versions if they are available.
That should get a normal developer grepping through their distros's package lists.
I happen to be on Fedora, and found I needed
librados-devel-1:10.2.4-2.fc25.x86_64
librbd-devel-1:10.2.4-2.fc25.x86_64
For mon_command, it appears that the inbuf is always set to empty: https://github.com/ceph/go-ceph/blob/master/rados/conn.go#L272
I believe inbuf is needed for commands such as "osd setcrushmap":
https://github.com/ceph/ceph/blob/master/src/mon/MonCommands.h#L507
https://github.com/ceph/ceph/blob/fffb8fc0dbb07c3c9950b5da2bd743462b4db0d0/src/ceph.in#L425
Is there a workaround or an easy fix? Thanks for all the work on this project so far!
the micro-osd.sh script in ci directory starts a small ceph cluster including an mds node used for the cephfs binding tests. with recent changes to ceph the micro-osd.sh script is starting the mds, but clients receive EACCESS when trying to create a directory. This is probably just something with the auth or way I'm creating the keys.
For now the cephfs tests are disabled on CI but it'd be great to get that micro-osd.sh fixed so we can enable them again.
i that any plan to add support for rbd/rados async read&write?
I am trying to get a basic version working on my local ceph installation. However, I keep getting operation not supported, however it seems luminous is supported by this library. Any help would be greatly appreciated.
Go code:
package main
import (
"fmt"
"flag"
rados "github.com/ceph/go-ceph/rados"
)
var addr *string = flag.String("addr", "", "a string")
func main(){
flag.Parse()
fmt.Println("Starting")
conn, err := rados.NewConn(); if err != nil {
panic( err )
}
fmt.Println("Connection created")
err = conn.ParseCmdLineArgs( []string{ "--mon-host", *addr } ); if err != nil {
panic( err )
}
err = conn.ReadDefaultConfigFile(); if err != nil {
panic( err )
}
fmt.Println("Read Default Config")
err = conn.Connect(); if err != nil {
panic( err )
}
fmt.Println("Connected")
pools, _ := conn.ListPools()
fmt.Println(pools)
}
Build Script:
#/bin/bash
export CGO_CPPFLAGS="-I/ceph/src/include"
export CGO_LDFLAGS="-L/ceph/build/lib"
go build .
Ceph Versions:
$ ceph osd versions
{
"ceph version 12.2.1 (3e7492b9ada8bdc9a5cd0feafd42fbca27f9c38e) luminous (stable)": 63
}
$ ceph mon versions
{
"ceph version 12.2.2 (cf0baeeeeba3b47f9427c6c97e2144b094b7e5ba) luminous (stable)": 3
}
Application output:
Starting
Connection created
Read Default Config
panic: rados: Operation not supported
goroutine 1 [running]:
main.main()
/go/src/github.com/org/repo/main.go:29 +0x3b1
root@9f755bc45121:/go# go get github.com/ceph/go-ceph
# github.com/ceph/go-ceph/rbd
src/github.com/ceph/go-ceph/rbd/rbd.go:32:23: could not determine kind of name for C.RBD_FEATURES_DEFAULT
src/github.com/ceph/go-ceph/rbd/rbd.go:30:28: could not determine kind of name for C.RBD_FEATURE_DATA_POOL
src/github.com/ceph/go-ceph/rbd/rbd.go:952:22: could not determine kind of name for C.rbd_trash_image_info_t
src/github.com/ceph/go-ceph/rbd/rbd.go:948:5: could not determine kind of name for C.rbd_trash_list
src/github.com/ceph/go-ceph/rbd/rbd.go:969:2: could not determine kind of name for C.rbd_trash_list_cleanup
src/github.com/ceph/go-ceph/rbd/rbd.go:264:18: could not determine kind of name for C.rbd_trash_move
src/github.com/ceph/go-ceph/rbd/rbd.go:979:18: could not determine kind of name for C.rbd_trash_remove
src/github.com/ceph/go-ceph/rbd/rbd.go:990:18: could not determine kind of name for C.rbd_trash_restore
OS: Debian stretch
golang: 1.10.3
libcephfs-dev, librbd-dev, librados-dev version: 10.2.5-7.2
I'm not sure if this is a version issue.
@noahdesu is it possible to get pool Id from pool name? in ceph-csi, we use pool id to encode volume ID
Hello,
Really appreciate all work you've done but is there any chance of realization diff_iterate function in rbd package.
Thanks.
I can't find in the librados documentation (or the ceph-go documentation) when in the process the non-aio writes return. Is the data in memory on a majority of the pg, in memory on all of the pg, or on disk on all of the pg?
Thanks
https://github.com/ceph/go-ceph#object-io has the code:
// write some data
bytes_in := []byte("input data")
err = ioctx.Write("obj", bytes_in, 0)
// read the data back out
bytes_out := make([]byte, len(bytes_in))
n_out, err := ioctx.Read("obj", bytes_out, 0)
if bytes_in != bytes_out {
fmt.Println("Output is not input!")
}
But that final comparison isn't valid Go. You can only compare a slice to nil
, not to other slices.
So that example wouldn't even compile.
(Lesser nit: Go doesn't use underscores in variable names, so idiomatic Go would be bytesIn
and bytesOut
)
which version of ceph that the go-ceph support? anyone know that?
The trash
subcommand of the rbd
command caught my attention recently, and it would be very useful to have wrappers for these functions in go-ceph. Although the functionality is available in Luminous (and maybe earlier?), it is only documented in the rbd
manpage in current master branch.
The relevant functions that would need wrappers are defined in librbd.h:
CEPH_RBD_API int rbd_trash_move(rados_ioctx_t io, const char *name,
uint64_t delay);
CEPH_RBD_API int rbd_trash_get(rados_ioctx_t io, const char *id,
rbd_trash_image_info_t *info);
CEPH_RBD_API void rbd_trash_get_cleanup(rbd_trash_image_info_t *info);
CEPH_RBD_API int rbd_trash_list(rados_ioctx_t io,
rbd_trash_image_info_t *trash_entries,
size_t *num_entries);
CEPH_RBD_API void rbd_trash_list_cleanup(rbd_trash_image_info_t *trash_entries,
size_t num_entries);
CEPH_RBD_API int rbd_trash_remove(rados_ioctx_t io, const char *id, bool force);
CEPH_RBD_API int rbd_trash_remove_with_progress(rados_ioctx_t io, const char *id,
bool force, librbd_progress_fn_t cb,
void *cbdata);
CEPH_RBD_API int rbd_trash_restore(rados_ioctx_t io, const char *id,
const char *name);
I can probably have a go at this myself, but I'm just not sure what the current status is as far as go-ceph supporting backwards compatibility. Obviously it will fail to build against Jewel, Kraken etc if we just blindly add these functions.
A continuation of contiv-experimental/volplugin#10 -- gathering requirements for the mapping patches.
When passed an empty data slice, IOContext.Write
panics due to an index out of range triggered by the data[0]
on line 103 of ioctx.go
:
Line 103 in bd5bc6d
If librados supports zero byte objects, my expectation would be that go-ceph should as well. If it does not, then I'd expect go-ceph to return an error rather than resulting in a panic.
When I compile go-ceph I get:
# github.com/ceph/go-ceph/rados
cgo-gcc-prolog: In function ‘_cgo_c03cef46a91f_Cfunc_rados_objects_list_close’:
cgo-gcc-prolog:348:2: warning: ‘rados_objects_list_close’ is deprecated [-Wdeprecated-declarations]
In file included from ../../../ceph/go-ceph/rados/ioctx.go:6:0:
/usr/include/rados/librados.h:3750:21: note: declared here
CEPH_RADOS_API void rados_objects_list_close(
^
cgo-gcc-prolog: In function ‘_cgo_c03cef46a91f_Cfunc_rados_objects_list_get_pg_hash_position’:
cgo-gcc-prolog:364:2: warning: ‘rados_objects_list_get_pg_hash_position’ is deprecated [-Wdeprecated-declarations]
In file included from ../../../ceph/go-ceph/rados/ioctx.go:6:0:
/usr/include/rados/librados.h:3741:25: note: declared here
CEPH_RADOS_API uint32_t rados_objects_list_get_pg_hash_position(
^
cgo-gcc-prolog: In function ‘_cgo_c03cef46a91f_Cfunc_rados_objects_list_next’:
cgo-gcc-prolog:384:2: warning: ‘rados_objects_list_next’ is deprecated [-Wdeprecated-declarations]
In file included from ../../../ceph/go-ceph/rados/ioctx.go:6:0:
/usr/include/rados/librados.h:3746:20: note: declared here
CEPH_RADOS_API int rados_objects_list_next(
^
cgo-gcc-prolog: In function ‘_cgo_c03cef46a91f_Cfunc_rados_objects_list_open’:
cgo-gcc-prolog:403:2: warning: ‘rados_objects_list_open’ is deprecated [-Wdeprecated-declarations]
In file included from ../../../ceph/go-ceph/rados/ioctx.go:6:0:
/usr/include/rados/librados.h:3738:20: note: declared here
CEPH_RADOS_API int rados_objects_list_open(
^
cgo-gcc-prolog: In function ‘_cgo_c03cef46a91f_Cfunc_rados_objects_list_seek’:
cgo-gcc-prolog:423:2: warning: ‘rados_objects_list_seek’ is deprecated [-Wdeprecated-declarations]
In file included from ../../../ceph/go-ceph/rados/ioctx.go:6:0:
/usr/include/rados/librados.h:3743:25: note: declared here
CEPH_RADOS_API uint32_t rados_objects_list_seek(
^
cgo-gcc-prolog: In function ‘_cgo_c03cef46a91f_Cfunc_rados_read_op_omap_get_vals’:
cgo-gcc-prolog:497:2: warning: ‘rados_read_op_omap_get_vals’ is deprecated [-Wdeprecated-declarations]
In file included from ../../../ceph/go-ceph/rados/ioctx.go:6:0:
/usr/include/rados/librados.h:3271:21: note: declared here
CEPH_RADOS_API void rados_read_op_omap_get_vals(rados_read_op_t read_op,
My librados is from luminous
Is it possible to add support for the rados locking functions (like rados_lock_exclusive)? I'm porting code from using librados via CGO directly to using this go library, but I would like to use these functions.
Thanks!
The rbd module's Image.Open function is rather non-idiomatic for Go code. It accepts any number of interface{}
arguments and then loops on them checking (only!) the type and uses those to select which ceph api function to run.
This means that x.Open("foo", true)
and x.Open(true, "foo")
are equivalent, as well as x.Open("foo", "foo", false, "bar", true, false, "foo", true)
. I've never seen go code like that! :-)
I'm not sure if this function wanted to mimic the style of the python api or what but it strikes me as odd.
It would be preferable to create more idiomatic approaches to Image type and the rbd open functions and then deprecate this approach to Open.
I would like to introduce the topic of having releases for go-ceph. This would also be related to #70 in the sense of dependency versioning.
For many this will act as a point of stability for CI/CD where pegged code releases can be used instead of relying on master branch. As good as a practice of writing tests for code, there is always the chance for new bugs to be introduced. Having release versions would help go-ceph users from introducing bugs that may be introduced via the master branch.
dep
(https://github.com/golang/dep) is one such tool that allows dependencies to be versioned to reduce the risk of introducing bugs into stable versions of go-ceph.
../github.com/ceph/go-ceph/rados/conn.go:5:11: fatal error: 'rados/librados.h' file not found
#include <rados/librados.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
Title says it all. librdb provides a rbd_create4 method. This method is not available in ceph-go's rbd implementation does not provide this at the moment.
Can this method be added?
func radosPut(file []byte, filename string) {
conn, _ := rados.NewConnWithUser("user")
conn.ReadConfigFile("/etc/.ceph/config")
if err := conn.Connect(); err != nil {
panic(err)
}
pools, _ := conn.ListPools()
fmt.Println(pools)
ioctx, err := conn.OpenIOContext("user_pool")
if err != nil {
panic(err)
}
err = ioctx.Write(filename, file, 0)
if err != nil {
panic(err)
}
conn.Shutdown()
}
[user_pool]
2018/05/09 14:13:22 http: panic serving 127.0.0.1:46182: runtime error: index out of range
goroutine 5 [running]:
net/http.(*conn).serve.func1(0xc4200c20a0)
/usr/local/go/src/net/http/server.go:1726 +0xd0
panic(0x937c00, 0xea50c0)
/usr/local/go/src/runtime/panic.go:502 +0x229
github.com/ceph/go-ceph/rados.(*IOContext).Write(0xc42035c020, 0xc42065f938, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/root/go/src/github.com/ceph/go-ceph/rados/ioctx.go:103 +0x121
Hi,
I get the following error with a fresh clone of the repository whilst running make test-docker
Package ceph is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'ceph' has no installation candidate
E: Unable to locate package librados-dev
E: Unable to locate package librbd-dev
E: Unable to locate package libcephfs-dev
The command '/bin/sh -c wget --no-check-certificate -q -O- 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' | apt-key add - && apt-get update && apt-get install -y ceph librados-dev librbd-dev libcephfs-dev' returned a non-zero code: 100
This will be helpful in ceph-csi if we want to consume the go-ceph library.
if we imported a released version tag (we are kind of safe. as a released branch is not frequently updated)
importing master in ceph-csi branch won't be a good idea as it can break anytime (due to merging for new PR's)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.