You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

268 lines
12 KiB

perf: websocket grid connectivity for all internode communication (#18461) This PR adds a WebSocket grid feature that allows servers to communicate via a single two-way connection. There are two request types: * Single requests, which are `[]byte => ([]byte, error)`. This is for efficient small roundtrips with small payloads. * Streaming requests which are `[]byte, chan []byte => chan []byte (and error)`, which allows for different combinations of full two-way streams with an initial payload. Only a single stream is created between two machines - and there is, as such, no server/client relation since both sides can initiate and handle requests. Which server initiates the request is decided deterministically on the server names. Requests are made through a mux client and server, which handles message passing, congestion, cancelation, timeouts, etc. If a connection is lost, all requests are canceled, and the calling server will try to reconnect. Registered handlers can operate directly on byte slices or use a higher-level generics abstraction. There is no versioning of handlers/clients, and incompatible changes should be handled by adding new handlers. The request path can be changed to a new one for any protocol changes. First, all servers create a "Manager." The manager must know its address as well as all remote addresses. This will manage all connections. To get a connection to any remote, ask the manager to provide it given the remote address using. ``` func (m *Manager) Connection(host string) *Connection ``` All serverside handlers must also be registered on the manager. This will make sure that all incoming requests are served. The number of in-flight requests and responses must also be given for streaming requests. The "Connection" returned manages the mux-clients. Requests issued to the connection will be sent to the remote. * `func (c *Connection) Request(ctx context.Context, h HandlerID, req []byte) ([]byte, error)` performs a single request and returns the result. Any deadline provided on the request is forwarded to the server, and canceling the context will make the function return at once. * `func (c *Connection) NewStream(ctx context.Context, h HandlerID, payload []byte) (st *Stream, err error)` will initiate a remote call and send the initial payload. ```Go // A Stream is a two-way stream. // All responses *must* be read by the caller. // If the call is canceled through the context, //The appropriate error will be returned. type Stream struct { // Responses from the remote server. // Channel will be closed after an error or when the remote closes. // All responses *must* be read by the caller until either an error is returned or the channel is closed. // Canceling the context will cause the context cancellation error to be returned. Responses <-chan Response // Requests sent to the server. // If the handler is defined with 0 incoming capacity this will be nil. // Channel *must* be closed to signal the end of the stream. // If the request context is canceled, the stream will no longer process requests. Requests chan<- []byte } type Response struct { Msg []byte Err error } ``` There are generic versions of the server/client handlers that allow the use of type safe implementations for data types that support msgpack marshal/unmarshal.
2 years ago
  1. module github.com/minio/minio
  2. go 1.23.0
  3. toolchain go1.23.6
  4. require (
  5. cloud.google.com/go/storage v1.46.0
  6. github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0
  7. github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
  8. github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.5.0
  9. github.com/IBM/sarama v1.43.3
  10. github.com/alecthomas/participle v0.7.1
  11. github.com/beevik/ntp v1.4.3
  12. github.com/buger/jsonparser v1.1.1
  13. github.com/cespare/xxhash/v2 v2.3.0
  14. github.com/cheggaaa/pb v1.0.29
  15. github.com/coreos/go-oidc/v3 v3.11.0
  16. github.com/coreos/go-systemd/v22 v22.5.0
  17. github.com/cosnicolaou/pbzip2 v1.0.5
  18. github.com/dchest/siphash v1.2.3
  19. github.com/dustin/go-humanize v1.0.1
  20. github.com/eclipse/paho.mqtt.golang v1.5.0
  21. github.com/elastic/go-elasticsearch/v7 v7.17.10
  22. github.com/fatih/color v1.18.0
  23. github.com/felixge/fgprof v0.9.5
  24. github.com/fraugster/parquet-go v0.12.0
  25. github.com/go-ldap/ldap/v3 v3.4.8
  26. github.com/go-openapi/loads v0.22.0
  27. github.com/go-sql-driver/mysql v1.8.1
  28. github.com/gobwas/ws v1.4.0
  29. github.com/golang-jwt/jwt/v4 v4.5.1
  30. github.com/gomodule/redigo v1.9.2
  31. github.com/google/uuid v1.6.0
  32. github.com/inconshreveable/mousetrap v1.1.0
  33. github.com/json-iterator/go v1.1.12
  34. github.com/klauspost/compress v1.17.11
  35. github.com/klauspost/cpuid/v2 v2.2.9
  36. github.com/klauspost/filepathx v1.1.1
  37. github.com/klauspost/pgzip v1.2.6
  38. github.com/klauspost/readahead v1.4.0
  39. github.com/klauspost/reedsolomon v1.12.4
  40. github.com/lib/pq v1.10.9
  41. github.com/lithammer/shortuuid/v4 v4.0.0
  42. github.com/miekg/dns v1.1.62
  43. github.com/minio/cli v1.24.2
  44. github.com/minio/console v1.7.6
  45. github.com/minio/csvparser v1.0.0
  46. github.com/minio/dnscache v0.1.1
  47. github.com/minio/dperf v0.6.3
  48. github.com/minio/highwayhash v1.0.3
  49. github.com/minio/kms-go/kes v0.3.1
  50. github.com/minio/kms-go/kms v0.4.0
  51. github.com/minio/madmin-go/v3 v3.0.94
  52. github.com/minio/minio-go/v7 v7.0.85
  53. github.com/minio/mux v1.9.0
  54. github.com/minio/pkg/v3 v3.0.29
  55. github.com/minio/selfupdate v0.6.0
  56. github.com/minio/simdjson-go v0.4.5
  57. github.com/minio/sio v0.4.1
  58. github.com/minio/xxml v0.0.3
  59. github.com/minio/zipindex v0.4.0
  60. github.com/mitchellh/go-homedir v1.1.0
  61. github.com/nats-io/nats-server/v2 v2.9.23
  62. github.com/nats-io/nats.go v1.37.0
  63. github.com/nats-io/stan.go v0.10.4
  64. github.com/ncw/directio v1.0.5
  65. github.com/nsqio/go-nsq v1.1.0
  66. github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c
  67. github.com/pierrec/lz4/v4 v4.1.21
  68. github.com/pkg/errors v0.9.1
  69. github.com/pkg/sftp v1.13.7
  70. github.com/pkg/xattr v0.4.10
  71. github.com/prometheus/client_golang v1.20.5
  72. github.com/prometheus/client_model v0.6.1
  73. github.com/prometheus/common v0.62.0
  74. github.com/prometheus/procfs v0.15.1
  75. github.com/puzpuzpuz/xsync/v3 v3.4.0
  76. github.com/rabbitmq/amqp091-go v1.10.0
  77. github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
  78. github.com/rs/cors v1.11.1
  79. github.com/secure-io/sio-go v0.3.1
  80. github.com/shirou/gopsutil/v3 v3.24.5
  81. github.com/tinylib/msgp v1.2.5
  82. github.com/valyala/bytebufferpool v1.0.0
  83. github.com/xdg/scram v1.0.5
  84. github.com/zeebo/xxh3 v1.0.2
  85. go.etcd.io/etcd/api/v3 v3.5.18
  86. go.etcd.io/etcd/client/v3 v3.5.18
  87. go.uber.org/atomic v1.11.0
  88. go.uber.org/zap v1.27.0
  89. goftp.io/server/v2 v2.0.1
  90. golang.org/x/crypto v0.35.0
  91. golang.org/x/oauth2 v0.26.0
  92. golang.org/x/sync v0.11.0
  93. golang.org/x/sys v0.30.0
  94. golang.org/x/term v0.29.0
  95. golang.org/x/time v0.8.0
  96. google.golang.org/api v0.213.0
  97. gopkg.in/yaml.v2 v2.4.0
  98. gopkg.in/yaml.v3 v3.0.1
  99. )
  100. require (
  101. aead.dev/mem v0.2.0 // indirect
  102. aead.dev/minisign v0.3.0 // indirect
  103. cel.dev/expr v0.19.0 // indirect
  104. cloud.google.com/go v0.116.0 // indirect
  105. cloud.google.com/go/auth v0.13.0 // indirect
  106. cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
  107. cloud.google.com/go/compute/metadata v0.6.0 // indirect
  108. cloud.google.com/go/iam v1.2.2 // indirect
  109. cloud.google.com/go/monitoring v1.21.2 // indirect
  110. filippo.io/edwards25519 v1.1.0 // indirect
  111. github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
  112. github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
  113. github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 // indirect
  114. github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect
  115. github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0 // indirect
  116. github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0 // indirect
  117. github.com/VividCortex/ewma v1.2.0 // indirect
  118. github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
  119. github.com/apache/thrift v0.21.0 // indirect
  120. github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
  121. github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
  122. github.com/beorn7/perks v1.0.1 // indirect
  123. github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
  124. github.com/charmbracelet/bubbles v0.20.0 // indirect
  125. github.com/charmbracelet/bubbletea v1.3.0 // indirect
  126. github.com/charmbracelet/lipgloss v1.0.0 // indirect
  127. github.com/charmbracelet/x/ansi v0.8.0 // indirect
  128. github.com/charmbracelet/x/term v0.2.1 // indirect
  129. github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
  130. github.com/coreos/go-semver v0.3.1 // indirect
  131. github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
  132. github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
  133. github.com/docker/go-units v0.5.0 // indirect
  134. github.com/eapache/go-resiliency v1.7.0 // indirect
  135. github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
  136. github.com/eapache/queue v1.1.0 // indirect
  137. github.com/envoyproxy/go-control-plane v0.13.1 // indirect
  138. github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
  139. github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
  140. github.com/fatih/structs v1.1.0 // indirect
  141. github.com/felixge/httpsnoop v1.0.4 // indirect
  142. github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
  143. github.com/go-ini/ini v1.67.0 // indirect
  144. github.com/go-jose/go-jose/v4 v4.0.5 // indirect
  145. github.com/go-logr/logr v1.4.2 // indirect
  146. github.com/go-logr/stdr v1.2.2 // indirect
  147. github.com/go-ole/go-ole v1.3.0 // indirect
  148. github.com/go-openapi/analysis v0.23.0 // indirect
  149. github.com/go-openapi/errors v0.22.0 // indirect
  150. github.com/go-openapi/jsonpointer v0.21.0 // indirect
  151. github.com/go-openapi/jsonreference v0.21.0 // indirect
  152. github.com/go-openapi/runtime v0.28.0 // indirect
  153. github.com/go-openapi/spec v0.21.0 // indirect
  154. github.com/go-openapi/strfmt v0.23.0 // indirect
  155. github.com/go-openapi/swag v0.23.0 // indirect
  156. github.com/go-openapi/validate v0.24.0 // indirect
  157. github.com/gobwas/httphead v0.1.0 // indirect
  158. github.com/gobwas/pool v0.2.1 // indirect
  159. github.com/goccy/go-json v0.10.5 // indirect
  160. github.com/gogo/protobuf v1.3.2 // indirect
  161. github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
  162. github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
  163. github.com/golang/protobuf v1.5.4 // indirect
  164. github.com/golang/snappy v0.0.4 // indirect
  165. github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
  166. github.com/google/s2a-go v0.1.8 // indirect
  167. github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
  168. github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
  169. github.com/googleapis/gax-go/v2 v2.14.0 // indirect
  170. github.com/gorilla/websocket v1.5.3 // indirect
  171. github.com/hashicorp/errwrap v1.1.0 // indirect
  172. github.com/hashicorp/go-multierror v1.1.1 // indirect
  173. github.com/hashicorp/go-uuid v1.0.3 // indirect
  174. github.com/hashicorp/golang-lru v1.0.2 // indirect
  175. github.com/jcmturner/aescts/v2 v2.0.0 // indirect
  176. github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
  177. github.com/jcmturner/gofork v1.7.6 // indirect
  178. github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
  179. github.com/jcmturner/rpc/v2 v2.0.3 // indirect
  180. github.com/jedib0t/go-pretty/v6 v6.6.5 // indirect
  181. github.com/jessevdk/go-flags v1.6.1 // indirect
  182. github.com/josharian/intern v1.0.0 // indirect
  183. github.com/juju/ratelimit v1.0.2 // indirect
  184. github.com/kr/fs v0.1.0 // indirect
  185. github.com/kylelemons/godebug v1.1.0 // indirect
  186. github.com/lestrrat-go/blackmagic v1.0.2 // indirect
  187. github.com/lestrrat-go/httpcc v1.0.1 // indirect
  188. github.com/lestrrat-go/httprc v1.0.6 // indirect
  189. github.com/lestrrat-go/iter v1.0.2 // indirect
  190. github.com/lestrrat-go/jwx/v2 v2.1.3 // indirect
  191. github.com/lestrrat-go/option v1.0.1 // indirect
  192. github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
  193. github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
  194. github.com/mailru/easyjson v0.9.0 // indirect
  195. github.com/mattn/go-colorable v0.1.14 // indirect
  196. github.com/mattn/go-ieproxy v0.0.12 // indirect
  197. github.com/mattn/go-isatty v0.0.20 // indirect
  198. github.com/mattn/go-localereader v0.0.1 // indirect
  199. github.com/mattn/go-runewidth v0.0.16 // indirect
  200. github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
  201. github.com/minio/colorjson v1.0.8 // indirect
  202. github.com/minio/filepath v1.0.0 // indirect
  203. github.com/minio/mc v0.0.0-20250208210632-10c50368c526 // indirect
  204. github.com/minio/md5-simd v1.1.2 // indirect
  205. github.com/minio/websocket v1.6.0 // indirect
  206. github.com/mitchellh/mapstructure v1.5.0 // indirect
  207. github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
  208. github.com/modern-go/reflect2 v1.0.2 // indirect
  209. github.com/montanaflynn/stats v0.7.1 // indirect
  210. github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
  211. github.com/muesli/cancelreader v0.2.2 // indirect
  212. github.com/muesli/reflow v0.3.0 // indirect
  213. github.com/muesli/termenv v0.15.2 // indirect
  214. github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
  215. github.com/nats-io/jwt/v2 v2.5.0 // indirect
  216. github.com/nats-io/nats-streaming-server v0.24.6 // indirect
  217. github.com/nats-io/nkeys v0.4.7 // indirect
  218. github.com/nats-io/nuid v1.0.1 // indirect
  219. github.com/oklog/ulid v1.3.1 // indirect
  220. github.com/olekukonko/tablewriter v0.0.5 // indirect
  221. github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
  222. github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
  223. github.com/posener/complete v1.2.3 // indirect
  224. github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
  225. github.com/prometheus/prom2json v1.4.1 // indirect
  226. github.com/prometheus/prometheus v0.301.0 // indirect
  227. github.com/rivo/uniseg v0.4.7 // indirect
  228. github.com/rjeczalik/notify v0.9.3 // indirect
  229. github.com/rs/xid v1.6.0 // indirect
  230. github.com/safchain/ethtool v0.5.10 // indirect
  231. github.com/segmentio/asm v1.2.0 // indirect
  232. github.com/shoenig/go-m1cpu v0.1.6 // indirect
  233. github.com/tidwall/gjson v1.18.0 // indirect
  234. github.com/tidwall/match v1.1.1 // indirect
  235. github.com/tidwall/pretty v1.2.1 // indirect
  236. github.com/tklauser/go-sysconf v0.3.14 // indirect
  237. github.com/tklauser/numcpus v0.9.0 // indirect
  238. github.com/unrolled/secure v1.17.0 // indirect
  239. github.com/vbauerster/mpb/v8 v8.9.2 // indirect
  240. github.com/xdg/stringprep v1.0.3 // indirect
  241. github.com/yusufpapurcu/wmi v1.2.4 // indirect
  242. go.etcd.io/etcd/client/pkg/v3 v3.5.18 // indirect
  243. go.mongodb.org/mongo-driver v1.17.2 // indirect
  244. go.opencensus.io v0.24.0 // indirect
  245. go.opentelemetry.io/auto/sdk v1.1.0 // indirect
  246. go.opentelemetry.io/contrib/detectors/gcp v1.32.0 // indirect
  247. go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 // indirect
  248. go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
  249. go.opentelemetry.io/otel v1.33.0 // indirect
  250. go.opentelemetry.io/otel/metric v1.33.0 // indirect
  251. go.opentelemetry.io/otel/sdk v1.33.0 // indirect
  252. go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect
  253. go.opentelemetry.io/otel/trace v1.33.0 // indirect
  254. go.uber.org/multierr v1.11.0 // indirect
  255. golang.org/x/mod v0.22.0 // indirect
  256. golang.org/x/net v0.35.0 // indirect
  257. golang.org/x/text v0.22.0 // indirect
  258. golang.org/x/tools v0.28.0 // indirect
  259. google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect
  260. google.golang.org/genproto/googleapis/api v0.0.0-20250207221924-e9438ea467c6 // indirect
  261. google.golang.org/genproto/googleapis/rpc v0.0.0-20250207221924-e9438ea467c6 // indirect
  262. google.golang.org/grpc v1.70.0 // indirect
  263. google.golang.org/protobuf v1.36.5 // indirect
  264. )