Skip to content

Commit

Permalink
Adding AllowUnsafeDMLs in vttablet configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro De Filippo <[email protected]>
  • Loading branch information
Alessandro De Filippo authored and Alessandro De Filippo committed Nov 5, 2018
1 parent be5efd9 commit e383487
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions go/vt/vttablet/tabletserver/query_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ func NewQueryEngine(checker connpool.MySQLChecker, se *schema.Engine, config tab
qe.streamBufferSize = sync2.NewAtomicInt64(int64(config.StreamBufferSize))

qe.passthroughDMLs = sync2.NewAtomicBool(config.PassthroughDMLs)
qe.allowUnsafeDMLs = config.AllowUnsafeDMLs
planbuilder.PassthroughDMLs = config.PassthroughDMLs

qe.accessCheckerLogger = logutil.NewThrottledLogger("accessChecker", 1*time.Second)
Expand Down
3 changes: 3 additions & 0 deletions go/vt/vttablet/tabletserver/tabletenv/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func init() {
flag.IntVar(&Config.WarnResultSize, "queryserver-config-warn-result-size", DefaultQsConfig.WarnResultSize, "query server result size warning threshold, warn if number of rows returned from vttablet for non-streaming queries exceeds this")
flag.IntVar(&Config.MaxDMLRows, "queryserver-config-max-dml-rows", DefaultQsConfig.MaxDMLRows, "query server max dml rows per statement, maximum number of rows allowed to return at a time for an update or delete with either 1) an equality where clauses on primary keys, or 2) a subselect statement. For update and delete statements in above two categories, vttablet will split the original query into multiple small queries based on this configuration value. ")
flag.BoolVar(&Config.PassthroughDMLs, "queryserver-config-passthrough-dmls", DefaultQsConfig.PassthroughDMLs, "query server pass through all dml statements without rewriting")
flag.BoolVar(&Config.AllowUnsafeDMLs, "queryserver-config-allowunsafe-dmls", DefaultQsConfig.AllowUnsafeDMLs, "query server allow unsafe dml statements")

flag.IntVar(&Config.StreamBufferSize, "queryserver-config-stream-buffer-size", DefaultQsConfig.StreamBufferSize, "query server stream buffer size, the maximum number of bytes sent from vttablet for each stream call. It's recommended to keep this value in sync with vtgate's stream_buffer_size.")
flag.IntVar(&Config.QueryPlanCacheSize, "queryserver-config-query-cache-size", DefaultQsConfig.QueryPlanCacheSize, "query server query cache size, maximum number of queries to be cached. vttablet analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache.")
Expand Down Expand Up @@ -134,6 +135,7 @@ type TabletConfig struct {
WarnResultSize int
MaxDMLRows int
PassthroughDMLs bool
AllowUnsafeDMLs bool
StreamBufferSize int
QueryPlanCacheSize int
SchemaReloadTime float64
Expand Down Expand Up @@ -205,6 +207,7 @@ var DefaultQsConfig = TabletConfig{
WarnResultSize: 0,
MaxDMLRows: 500,
PassthroughDMLs: false,
AllowUnsafeDMLs: false,
QueryPlanCacheSize: 5000,
SchemaReloadTime: 30 * 60,
QueryTimeout: 30,
Expand Down

0 comments on commit e383487

Please sign in to comment.