资讯详情

maxwell元数据问题

1.问题

"Couldn't find table xxx in xxxx  相关的schema问题

2.分析

2.1代码本身就有缺陷

saveSchema缺少savePosition

2.2DBA相关的操作

rename table `test`.`user`  to `test`.user_bak; rename table dev.user to `test`.`user`; 缺少这种场景schema的处理 解决方案 BinlogConnectorReplicator下针对捕获InvalidSchemaError处理
 public Schema lossSchema(String lossDb,String lossTab) throws SQLException, SchemaStoreException {   Schema oldSchema = null;   try(Connection connection = schemaConnectionPool.getConnection()) {    SchemaCapturer capturer = new SchemaCapturer(connection, caseSensitivity);    Database single = capturer.loss(lossDb,lossTab);    oldSchema = getSchema();    Database old = oldSchema.findDatabase(lossDb);    if(old==null){     oldSchema.getDatabases().add(single);     return oldSchema;    }    oldSchema.getDatabases()      .stream()      .filter(item -> item.getName().equalsIgnoreCase(lossDb))      .forEach(d->{       Table singleTable = single.getTableList().get(0);       if(d.hasTable(singleTable.getName())){        d.getTableList().forEach(t->{         if(t.getName().equalsIgnoreCase(singleTable.getName())){          t=singleTable;         }        });       }else{        d.addTable(singleTable);       }      });   }   if(oldSchema!=null){    savedSchema.setSchema(oldSchema);    savedSchema.saveForce(,true);   }   return oldSchema;  }

标签: maxwell超级电容攻丝

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台