Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    UNSOLVED mysql同步到ck 建表时报错

    问答区
    mysql同步ck
    2
    7
    32
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 梦想
      梦想 last edited by

      Console task execute with error. Context is {“resources”:[],“tryTimes”:null,“paramType”:null,“consoleJobId”:0,“dataJobId”:3}.
      Exception stack is “远程执行SQL失败,请联系管理员。错误信息为:invoke rcontroller method failed.Request id:2efa3f62-afe0-11ec-8e41-d77be1033198msg:Throwable: Code: 36. DB::Exception: Primary key must be a prefix of the sorting key, but the column in the position 1 is model_type, not model_id. (BAD_ARGUMENTS) (version 21.12.2.17 (official build))
      . Target sidecar is 172.31.238.4, route name is ck_rdbApplyScript”
      at com.clougence.cloudcanal.console.component.rsocket.service.base.AbstractRdbMetaRService.applyScript(AbstractRdbMetaRService.java:443)
      at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandlerForNew.applyScript(AbstractStructMigrationHandlerForNew.java:229)
      at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandlerForNew.tableMigration(AbstractStructMigrationHandlerForNew.java:217)
      at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.mysql.MySQLToCkStructHandler.schemaMigration(MySQLToCkStructHandler.java:143)
      at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.mysql.MySQLToCkStructHandler.migration(MySQLToCkStructHandler.java:96)
      at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandler.execute(AbstractStructMigrationHandler.java:148)
      at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandler.execute(AbstractStructMigrationHandler.java:61)
      at com.clougence.cloudcanal.console.component.consoletask.service.ConsoleJobManagerImpl.doExecuteJob(ConsoleJobManagerImpl.java:220)
      at com.clougence.cloudcanal.console.component.consoletask.service.ConsoleJobManagerImpl.lambda$doExecuteJobAsync$1(ConsoleJobManagerImpl.java:174)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

      junyu-cloudcanal 3 Replies Last reply Reply Quote 0
      • junyu-cloudcanal
        junyu-cloudcanal @梦想 last edited by

        @梦想 ok

        1 Reply Last reply Reply Quote 0
        • 梦想
          梦想 last edited by

          CREATE TABLE xxx (
          permission_id int(10) unsigned NOT NULL,
          model_type varchar(191) COLLATE utf8_unicode_ci NOT NULL,
          model_id bigint(20) unsigned NOT NULL,
          PRIMARY KEY (permission_id,model_id,model_type),
          KEY model_has_permissions_model_id_model_type_index (model_id,model_type)
          ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

          表结构

          junyu-cloudcanal 1 Reply Last reply Reply Quote 0
          • 梦想
            梦想 @junyu-cloudcanal last edited by

            @junyu-cloudcanal

            2022-03-30 12:16:33.626 INFO 38 — [reactor-tcp-epoll-2] c.c.c.c.c.rsocket.AsyncReceiverImpl : receive async result. request id:2eda0d30-afe0-11ec-8e41-8939a4bd8fdd
            2022-03-30 12:16:33.626 INFO 38 — [console-task-async-0-thread-0] c.c.c.c.c.r.s.b.AbstractRdbMetaRService : response msg:request success. Target sidecar is 172.31.238.4, route name is ck_rdbGetTable
            2022-03-30 12:16:33.626 INFO 38 — [console-task-async-0-thread-0] h.c.AbstractStructMigrationHandlerForNew : START TO MIGRATE TABLE:null.xx120105.model_has_permissions
            2022-03-30 12:16:33.730 INFO 38 — [reactor-tcp-epoll-2] c.c.c.c.c.rsocket.AsyncReceiverImpl : receive async result. request id:2eea12c1-afe0-11ec-8e41-9dd42d254bf1
            2022-03-30 12:16:33.730 INFO 38 — [console-task-async-0-thread-0] c.c.c.c.c.r.s.b.AbstractRdbMetaRService : response msg:request success. Target sidecar is 172.31.238.4, route name is ck_rdbGetTable
            2022-03-30 12:16:33.769 INFO 38 — [reactor-tcp-epoll-2] c.c.c.c.c.rsocket.AsyncReceiverImpl : receive async result. request id:2efa3f62-afe0-11ec-8e41-d77be1033198
            2022-03-30 12:16:33.769 ERROR 38 — [console-task-async-0-thread-0] c.c.c.c.c.r.s.b.AbstractRdbMetaRService : call applyScript from remote sidecar failed,response msg:invoke rcontroller method failed.Request id:2efa3f62-afe0-11ec-8e41-d77be1033198msg:Throwable: Code: 36. DB::Exception: Primary key must be a prefix of the sorting key, but the column in the position 1 is model_type, not model_id. (BAD_ARGUMENTS) (version 21.12.2.17 (official build))
            . Target sidecar is 172.31.238.4, route name is ck_rdbApplyScript
            2022-03-30 12:16:33.794 INFO 38 — [console-task-async-0-thread-0] c.c.cloudcanal.console.util.I18nUtil : err : 8019, args : [“invoke rcontroller method failed.Request id:2efa3f62-afe0-11ec-8e41-d77be1033198msg:Throwable: Code: 36. DB::Exception: Primary key must be a prefix of the sorting key, but the column in the position 1 is model_type, not model_id. (BAD_ARGUMENTS) (version 21.12.2.17 (official build))\n. Target sidecar is 172.31.238.4, route name is ck_rdbApplyScript”]
            2022-03-30 12:16:33.795 ERROR 38 — [console-task-async-0-thread-0] c.c.c.h.c.AbstractStructMigrationHandler : data job 3 struct migration error.msg:ConsoleRuntimeException: “远程执行SQL失败,请联系管理员。错误信息为:invoke rcontroller method failed.Request id:2efa3f62-afe0-11ec-8e41-d77be1033198msg:Throwable: Code: 36. DB::Exception: Primary key must be a prefix of the sorting key, but the column in the position 1 is model_type, not model_id. (BAD_ARGUMENTS) (version 21.12.2.17 (official build))
            . Target sidecar is 172.31.238.4, route name is ck_rdbApplyScript”

            com.clougence.cloudcanal.console.common.exception.ConsoleRuntimeException: “远程执行SQL失败,请联系管理员。错误信息为:invoke rcontroller method failed.Request id:2efa3f62-afe0-11ec-8e41-d77be1033198msg:Throwable: Code: 36. DB::Exception: Primary key must be a prefix of the sorting key, but the column in the position 1 is model_type, not model_id. (BAD_ARGUMENTS) (version 21.12.2.17 (official build))
            . Target sidecar is 172.31.238.4, route name is ck_rdbApplyScript”
            at com.clougence.cloudcanal.console.component.rsocket.service.base.AbstractRdbMetaRService.applyScript(AbstractRdbMetaRService.java:443)
            at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandlerForNew.applyScript(AbstractStructMigrationHandlerForNew.java:229)
            at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandlerForNew.tableMigration(AbstractStructMigrationHandlerForNew.java:217)
            at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.mysql.MySQLToCkStructHandler.schemaMigration(MySQLToCkStructHandler.java:143)
            at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.mysql.MySQLToCkStructHandler.migration(MySQLToCkStructHandler.java:96)
            at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandler.execute(AbstractStructMigrationHandler.java:148)
            at com.clougence.cloudcanal.console.component.consoletask.handler.createdatajob.AbstractStructMigrationHandler.execute(AbstractStructMigrationHandler.java:61)
            at com.clougence.cloudcanal.console.component.consoletask.service.ConsoleJobManagerImpl.doExecuteJob(ConsoleJobManagerImpl.java:220)
            at com.clougence.cloudcanal.console.component.consoletask.service.ConsoleJobManagerImpl.lambda$doExecuteJobAsync$1(ConsoleJobManagerImpl.java:174)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)

            看着应该像是.xx120105.model_has_permissions 这张表吧

            1 Reply Last reply Reply Quote 0
            • junyu-cloudcanal
              junyu-cloudcanal @梦想 last edited by

              @梦想 sidecar.log的日志目录下有 rsocket-xxxx-error.log

              1 Reply Last reply Reply Quote 0
              • junyu-cloudcanal
                junyu-cloudcanal @梦想 last edited by

                @梦想 另外那张表的话,可能得看下 sidecar 里面的日志了。https://www.askcug.com/topic/349

                梦想 1 Reply Last reply Reply Quote 0
                • junyu-cloudcanal
                  junyu-cloudcanal @梦想 last edited by

                  @梦想 能提供下表结构么?我们直接验证下。

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Copyright © 2020 ClouGence, Inc.备案号:浙ICP备20007605号-2