Skip to content

Commit

Permalink
Merge pull request #112 from Altinity/release-0.3.0
Browse files Browse the repository at this point in the history
 dev: retry for CREATE and DROP TABLE
  • Loading branch information
alex-zaitsev committed Jun 1, 2019
2 parents adbbe9e + 8f07ad0 commit 0a91caa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/chi/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ func (c *Controller) onUpdateChi(old, new *chop.ClickHouseInstallation) error {
new.WalkClusters(func(cluster *chop.ChiCluster) error {
dbNames, createDatabaseSQLs, _ := c.schemer.ClusterGetCreateDatabases(new, cluster)
glog.V(1).Infof("Creating databases: %v", dbNames)
_ = c.schemer.ClusterApplySQLs(cluster, createDatabaseSQLs, false)
_ = c.schemer.ClusterApplySQLs(cluster, createDatabaseSQLs, true)

tableNames, createTableSQLs, _ := c.schemer.ClusterGetCreateTables(new, cluster)
glog.V(1).Infof("Creating tables: %v", tableNames)
_ = c.schemer.ClusterApplySQLs(cluster, createTableSQLs, false)
_ = c.schemer.ClusterApplySQLs(cluster, createTableSQLs, true)
return nil
})
_ = c.updateCHIResource(new)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/chi/deleters.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Controller) deleteTablesOnReplica(replica *chop.ChiReplica) {
// Delete tables on replica
tableNames, dropTableSQLs, _ := c.schemer.ReplicaGetDropTables(replica)
glog.V(1).Infof("Drop tables: %v as %v", tableNames, dropTableSQLs)
_ = c.schemer.ReplicaApplySQLs(replica, dropTableSQLs, false)
_ = c.schemer.ReplicaApplySQLs(replica, dropTableSQLs, true)
}

// deleteReplica deletes all kubernetes resources related to replica *chop.ChiReplica
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (c *Conn) Exec(sql string) error {
}

if err := connect.Ping(); err != nil {
glog.V(1).Infof("FAILED Ping(%d) %v for SQL: %s", dsn, err, sql)
glog.V(1).Infof("FAILED Ping(%s) %v for SQL: %s", dsn, err, sql)
return err
}

Expand Down

0 comments on commit 0a91caa

Please sign in to comment.