fix transaction too large error when use TiDB as storage#5754
fix transaction too large error when use TiDB as storage#5754moonsphere wants to merge 5 commits into
Conversation
wu-sheng
left a comment
There was a problem hiding this comment.
Seems you miss the update of default application.yaml in the bootstrap module, configuration vocabulary doc after you changed the YAML, and storage setup doc.
| import java.sql.Connection; | ||
| import java.sql.SQLException; | ||
|
|
||
| public class TiDBHistoryDeleteDAO extends H2HistoryDeleteDAO { |
There was a problem hiding this comment.
Please add comments about why you need this.
| * caution: need add "useAffectedRows=true" to jdbc url. | ||
| */ | ||
| @Slf4j | ||
| public class TiDBStorageProvider extends MySQLStorageProvider { |
There was a problem hiding this comment.
If you have a new provider, we need a new maven module for tidb storage, and make it compiled as a separate jar.
Codecov Report
@@ Coverage Diff @@
## master #5754 +/- ##
============================================
- Coverage 51.47% 0.00% -51.48%
============================================
Files 1644 161 -1483
Lines 35215 3914 -31301
Branches 3841 459 -3382
============================================
- Hits 18127 0 -18127
+ Misses 16186 3914 -12272
+ Partials 902 0 -902 Continue to review full report at Codecov.
|
|
@moonsphere I have a direct talk with PingCap's friends, right now, as a minor change, this deletion way seems the best choice. |
|
@moonsphere Are you still working on this? |
|
As no update, this is going to be replaced by #5844 |
Closes #5749
TiDB can not delete many rows in one transaction.
so maybe we can use @xxxlxy2008 's genius idea --- split one
deletestmt into multipledeletestmt withlimitand loop until all wanted data has be deletedto detect affect-row, users need ensure "useAffectedRows=true" must be configured in jdbc url.
to don't affect MySQL logic, we can extend a new
TiDBStorageProvider, TiDB user can useto replace
to use this patch.