Coder Social home page Coder Social logo

ColumnMap vs reversed job about dtle HOT 4 CLOSED

 avatar commented on June 28, 2024
ColumnMap vs reversed job

from dtle.

Comments (4)

 avatar commented on June 28, 2024

关于“创建反向复制任务”

  • 正向和反向job不同时进行.
  • 反向任务创建后, 暂时挂起, 等待正向任务finish
  • 正向任务触发finish后, 记录正向任务源端Gtid为targetGtid, 此时正向任务目标端未必执行完毕
  • 反向任务等待正向任务执行到targetGtid后, 反向任务启动

适用于切换复制方向的场景.

from dtle.

 avatar commented on June 28, 2024

关于TwoWaySync

  • 持续进行双向复制
  • 代替之前双job方案
    • 双job有潜在的无限循环问题

目前TwoWaySync会在反向任务使用正向任务的ColumnMap, 实为Bug.

from dtle.

 avatar commented on June 28, 2024

方案1

对于反向任务, 交换 使用正向任务的ColumnMapFrom/To (参数行为见文档).

考虑下列几个场景, 都能满足使用意图

选择列

正向

  • src table (id, val1, val2)
  • dst table (id, val2)
  • ColumnMapFrom (id, val2)
  • ColumnMapTo (id, val2)

反向

  • from (id, val2)
  • to (id, val2)
  • 要求val1 可空或有默认值

选择列 + 重建自增id + 列重命名

正向

  • src table (id auto_increment, val1, val2)
  • dst table (id auto_increment, val1x, val2x)
  • from (val1, val2)
  • to (val1x, val2x)

reverse job

  • from (val1x, val2x)
  • to (val1, val2)

目标端多出列(有默认值)

正向

  • src table (id, val1)
  • dst table (id, val2 default 42, val1x)
  • from (id, val1)
  • to (id, val1x)

反向

  • from (id, val1x)
  • to (id, val1)

from dtle.

asiroliu avatar asiroliu commented on June 28, 2024

verified:
version:
9.9.9.9-master-6075dea

验证点:

  • reversed job
    -- 源端多出列
    -- 目标端多出列
    -- 列重命名
    -- 列乱序
  • TwoWaySync
    -- 源端多出列
    -- 目标端多出列
    -- 列重命名
    -- 列乱序

from dtle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.