-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support mutable meta queries in a cluster #5753
Conversation
5ca27c5
to
b244af1
Compare
panic("wrong connection type in MetaExecutor") | ||
} | ||
// Return connection to pool by "closing" it. | ||
defer func(conn net.Conn) { conn.Close() }(conn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this wrapped in a function? Wouldn't this work the same:
defer conn.Close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somebody must have been smoking crack. whistles innocently
Minor comments, otherwise lgtm 👍 |
e4d714f
to
4424876
Compare
return &MetaExecutor{ | ||
timeout: DefaultWriteTimeout, | ||
pool: newClientPool(), | ||
maxConnections: 1000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this max connections per node? If so, default is too high. We use 3 per-node for writes. Also, should be a constant like: https://github.com/influxdata/influxdb/blob/master/cluster/config.go#L21
4424876
to
cdfde23
Compare
cdfde23
to
14668d1
Compare
The Meta Executor will make allow data nodes to execute queries remotely on each other, via RPC calls.
f91d492
to
b306476
Compare
Support mutable meta queries in a cluster
🏆 |
Fixes #5612, #5573 and #5518. Partially #2755
Adds support in a multi-node cluster for the following commands:
DROP DATABASE
;DROP MEASUREMENT
;DROP RETENTION POLICY
;DROP SERIES
.The approach is as follows. Queries that involve modifying data on Data Nodes will be handed off by the
QueryExecuter
to theMetaExecutor
. TheMetaExecutor
will then build appropriate messages and make RPC calls to all data nodes in the cluster.The node that received the query will apply any commands to its own
tsdb.Store
locally—they will not be sent over the network.Errors encountered from remotely executed commands will be collected by the
MetaExecutor
and the first of these (if any) returned to the user.Assuming no errors were returned by any data nodes, the node executing the original query will then make any calls necessary to the Meta Store.
Detailed Flow for
DROP DATABASE
:tsdb.Store
tsdb.Store.DeleteDatabase
.Errors propagate back from each node through RPC to the node that executed the statement on the cluster and that node returns failure if any node fails to execute.
TODO