1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Better detection for AllInSync condition for DC2DC sync status (#1417)

This commit is contained in:
Nikita Vaniasin 2023-09-22 13:57:17 +02:00 committed by GitHub
parent bdec82db95
commit 8f01324c5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View file

@ -22,6 +22,7 @@
- (Feature) ArangoMember Removal Priority
- (Feature) Add --deployment.feature.init-containers-copy-resources (default enabled)
- (Feature) Add maxBackups option to ArangoBackupPolicy
- (Improvement) Better detection for AllInSync condition for DC2DC sync status
## [1.2.32](https://github.com/arangodb/kube-arangodb/tree/1.2.32) (2023-08-07)
- (Feature) Backup lifetime - remove Backup once its lifetime has been reached

View file

@ -248,21 +248,21 @@ func (dr *DeploymentReplication) inspectIncomingSynchronizationStatus(destStatus
var totalShardsFromStatus, shardsInSync int
dbs := make(map[string]api.DatabaseSynchronizationStatus, 0)
for _, s := range destStatus.Shards {
db := dbs[s.Database]
for _, shard := range destStatus.Shards {
db := dbs[shard.Database]
db.ShardsTotal++
totalShardsFromStatus++
if s.Status == client.SyncStatusRunning {
if shard.Status == client.SyncStatusRunning {
db.ShardsInSync++
shardsInSync++
} else if s.Status == client.SyncStatusFailed && len(db.Errors) < maxReportedIncomingSyncErrorsPerDatabase {
} else if shard.Status == client.SyncStatusFailed && len(db.Errors) < maxReportedIncomingSyncErrorsPerDatabase {
db.Errors = append(db.Errors, api.DatabaseSynchronizationError{
Collection: s.Collection,
Shard: strconv.Itoa(s.ShardIndex),
Message: fmt.Sprintf("shard sync failed: %s", s.StatusMessage),
Collection: shard.Collection,
Shard: strconv.Itoa(shard.ShardIndex),
Message: fmt.Sprintf("shard sync failed: %s", shard.StatusMessage),
})
}
dbs[s.Database] = db
dbs[shard.Database] = db
}
var totalShards = destStatus.TotalShardsCount
@ -276,7 +276,7 @@ func (dr *DeploymentReplication) inspectIncomingSynchronizationStatus(destStatus
}
return api.SynchronizationStatus{
Progress: progress,
AllInSync: destStatus.Status == client.SyncStatusRunning,
AllInSync: destStatus.Status == client.SyncStatusRunning && shardsInSync == totalShards,
Databases: dbs,
Error: "",
}