shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

use `overwrite=true` & yaml, replace logic db in zk

Open wsm12138 opened this issue 3 years ago • 1 comments

Bug Report

Which version of ShardingSphere did you use?

91d2d46cf9ea4d139478c2c9c6de8734ade7d4a1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

show real table in logic db now

Actual behavior

show tables in logic db before

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

  1. start proxy in cluster mode
USE encrypt_db;
ADD RESOURCE ds (
    HOST="127.0.0.1",
    PORT=13309,
    DB="before",
    USER="root",
    PASSWORD="test"
);
  1. stop proxy
  2. start proxy with yaml
databaseName: encrypt_db
dataSources:
  ds_0:
    password: test
    url: jdbc:mysql://127.0.0.1:13309/after?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
    username: root
    minPoolSize: 1
    connectionTimeoutMilliseconds: 30000
    maxLifetimeMilliseconds: 1800000
    readOnly: false
    idleTimeoutMilliseconds: 60000
    maxPoolSize: 50
rules:
- !SINGLE {}
- !ENCRYPT
  encryptors:
    aes_encryptor:
      props:
        aes-key-value: 123456abc
      type: AES
  queryWithCipherColumn: false
  tables:
    sbtest1:
      columns:
        pad:
          cipherColumn: pad_encrypt
          encryptorName: aes_encryptor
          logicColumn: pad
          plainColumn: pad
      name: sbtest1

overwrite=true 4.export database config;& show tables in encrypt_db

image image
  1. refresh table metadata;
image

Example codes for reproduce this issue (such as a github link).

wsm12138 avatar Sep 19 '22 08:09 wsm12138

@wsm12138 Now, Proxy start up load governance center tables when governance center has tables. i see your datasource configuration db has changed. Do you think db has changed should be compare local and remote?

zhaojinchao95 avatar Sep 19 '22 13:09 zhaojinchao95

The overwrite parameter are deleted, please refer to #20552, and i think this is not a problem when finished it. So, i will close it.

zhaojinchao95 avatar Sep 28 '22 03:09 zhaojinchao95