-
Notifications
You must be signed in to change notification settings - Fork 188
Conversation
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==============================================
- Coverage 60.1288% 59.94% -0.1889%
==============================================
Files 136 135 -1
Lines 16448 15010 -1438
==============================================
- Hits 9890 8997 -893
+ Misses 5625 5141 -484
+ Partials 933 872 -61 |
@amyangfei @WangXiangUSTC PTAL |
41a0855
to
e0c0234
Compare
d31cf58
to
22d5987
Compare
loader has struct |
loader and syncer although have similar conn struct, but they also have different log content and stats content, so they are not same struct, if we unify their |
f6cc483
to
10d7d99
Compare
split workerConn and upstreamConn in syncer split conn and db unify conn in syncer and loader
645f501
to
f8ece5b
Compare
syncer/syncer.go
Outdated
@@ -920,11 +916,6 @@ func (s *Syncer) sync(ctx *tcontext.Context, queueBucket string, db *Conn, jobCh | |||
idx++ | |||
|
|||
if sqlJob.tp == ddl { | |||
err = executeSQLs() |
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.
this block of code is useless, so I removed it, @amyangfei please check it
@WangXiangUSTC @amyangfei PTAL |
please resolve the conflicts |
/run-all-tests |
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.
LGTM
cherry pick to release-1.0 failed |
* define conn split workerConn and upstreamConn in syncer split conn and db unify conn in syncer and loader * change upstream DB to BaseDB * update raw db config
* define conn split workerConn and upstreamConn in syncer split conn and db unify conn in syncer and loader * change upstream DB to BaseDB * update raw db config
What problem does this PR solve?
Optimize Database connections in dm-worker units, after unify DB operations
What is changed and how it works?
conn.DBProvider.Apply
*sql.DB
in upstream, and use individual connection for each worker in downstream.BaseDB generates BaseConn, BaseConn wraps sql.Conn with own retry policy
BaseDB -> BaseConn correspond to sql.DB -> sql.Conn
In our scenario, there are two main reasons why we need BaseConn
So we split a fixed sql.Conn out of sql.DB, and wraps it to BaseConn
And Similar with sql.Conn, all BaseConn generated from one BaseDB shares this BaseDB to reset
Check List
Tests
Code changes
Side effects
Related changes
dm/dm-ansible