You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/09/14 02:03:23 UTC
[GitHub] [shardingsphere] sandynz commented on a diff in pull request #20962: Improve drop pipeline process and IT
sandynz commented on code in PR #20962:
URL: https://github.com/apache/shardingsphere/pull/20962#discussion_r970230365
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/AbstractPipelineJobAPIImpl.java:
##########
@@ -75,7 +76,9 @@ public abstract class AbstractPipelineJobAPIImpl implements PipelineJobAPI {
@Override
public void createProcessConfiguration(final PipelineProcessConfiguration processConfig) {
PipelineProcessConfiguration existingProcessConfig = processConfigPersistService.load(getJobType());
- ShardingSpherePreconditions.checkState(null == existingProcessConfig, new CreateExistsProcessConfigurationException());
+ if (null != existingProcessConfig && ObjectUtils.allNotNull(existingProcessConfig.getRead(), existingProcessConfig.getWrite(), existingProcessConfig.getStreamChannel())) {
+ throw new CreateExistsProcessConfigurationException();
+ }
Review Comment:
1, Why add `ObjectUtils.allNotNull`, if there's part of process configured, create process configuration is still allowed?
2, Could we keep `ShardingSpherePreconditions.checkState`?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java:
##########
@@ -126,15 +126,14 @@ protected void startMigrationOrderItem(final boolean withSchema) throws SQLExcep
}
protected void addMigrationProcessConfig() throws SQLException {
- try {
- proxyExecuteWithLog(migrationDistSQLCommand.getAddMigrationProcessConfig(), 0);
- } catch (final SQLException ex) {
- if ("58000".equals(ex.getSQLState()) || "HY000".equals(ex.getSQLState())) {
- log.warn(ex.getMessage());
- return;
+ if (ENV.getItEnvType() == ITEnvTypeEnum.NATIVE) {
+ try {
+ proxyExecuteWithLog("DROP MIGRATION PROCESS CONFIGURATION '/read'", 1);
+ } catch (final SQLException ex) {
Review Comment:
`'/read'` could just clean `READ` configuraion, `'/'` could be used to clean process configuration
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org