修复代理与日志链路的可靠性问题
This commit is contained in:
@@ -214,6 +214,26 @@ func TestClosePreventsConcurrentConnectFromPublishing(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestOldGenerationCannotMarkReplacementUnhealthy(t *testing.T) {
|
||||
pool := &Pool{conn: newFakeClickHouseConn(), healthy: true, generation: 1}
|
||||
oldGeneration := pool.Generation()
|
||||
|
||||
pool.mu.Lock()
|
||||
pool.conn = newFakeClickHouseConn()
|
||||
pool.generation++
|
||||
pool.healthy = true
|
||||
pool.mu.Unlock()
|
||||
|
||||
pool.MarkUnhealthyGeneration(oldGeneration)
|
||||
if !pool.Healthy() {
|
||||
t.Fatal("old connection failure marked replacement connection unhealthy")
|
||||
}
|
||||
pool.MarkUnhealthyGeneration(pool.Generation())
|
||||
if pool.Healthy() {
|
||||
t.Fatal("current connection failure did not mark pool unhealthy")
|
||||
}
|
||||
}
|
||||
|
||||
func assertNonDestructiveMigration(t *testing.T, statements []string) {
|
||||
t.Helper()
|
||||
if len(statements) == 0 || !strings.Contains(strings.ToUpper(statements[0]), "CREATE TABLE IF NOT EXISTS") {
|
||||
|
||||
Reference in New Issue
Block a user