Project

General

Profile

Tasks #42276

gorados - pure go client to connect RADOS cluster

Added by Oshyn Song over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

30%

Tags:
Reviewed:
Affected Versions:
Pull request ID:

Description

There is requirement connecting to RADOS cluster by Golang, and the sub-project go-ceph(https://github.com/ceph/go-ceph) is the first solution. It uses cgo linking the librados library and works OK. I used go-ceph in one project, there are some problems annoying me:

  1. The connection created to the RADOS cluster must be closed explicitly, because golang runtime GC does not care about it. If your application holds a global connection and does not close, it will be a waste of resource of the RADOS cluster. Otherwise, you need to implement a connection pool for management, which increases complexity and needs a strong testing.
  2. librados is implemented with C/C++ and pthread thread model, and it heavily depends on the low-level messenger implementation. What I used in my project is the luminous version, and it will create 14 new threads when creating a connection to the RADOS cluster(use pstack on centos7). So the mixed threads used by the golang runtime and librados causes the problem here(https://stackoverflow.com/questions/47466139/there-are-many-threads-reserved-while-golang-application-running?answertab=votes#tab-top ).
  3. The golang program must depend on the librados when compiling and running, it decreases the maintainability compared with common static-built golang program.

There are also some problems if you use go-ceph in your golang project, such as the messenger layer is not efficient as golang. There is every reason to implement the gorados - pure go client to connect RADOS cluster - to make ceph as a backend storage in production-level golang project directly. I make this idea as a fact, and provide the draft startup on github: https://github.com/oshynsong/gorados. It implements the cephx protocol to connect the monitor, and needs more development. Welcome to join me and I hope gorados as a sub-project of ceph!

History

#1 Updated by Greg Farnum over 4 years ago

Awesome!

You'll get more visibility if you email the list, so perhaps you should take this there? :)

Also available in: Atom PDF