vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.4k stars 2.08k forks source link

Enforce max rows affected by passthrough DMLs #4724

Open dweitzman opened 5 years ago

dweitzman commented 5 years ago

Large transactions can overwhelm binlog consumers, cause replication delay, and might have other performance implications.

For those who prefer to encourage smaller transactions for bulk changes (hopefully throttled by whoever's running the DMLs), vttablet could count the rows affected in a transaction and if it exceeds some limit do a rollback + ResourceExhuasted.

dweitzman commented 5 years ago

A possible compilation: this might not be entirely compatible with CLIENT_FOUND_ROWS mode where DMLs return the number of rows scanned rather than modified

Seems like people could either choose to impose a limit on rows found or not enforce a limit

Sadly, the connector-j JDBC driver sets CLIENT_FOUND_ROWS by default.