Skip to content

Commit

Permalink
Fix bug in visibility double read when source visibility manager is p…
Browse files Browse the repository at this point in the history
…rimary (#6539)
  • Loading branch information
neil-xie authored Dec 3, 2024
1 parent d51adac commit dfe87ab
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions common/persistence/visibility_triple_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,17 @@ func (v *visibilityTripleManager) getShadowMgrForDoubleRead(domain string) Visib
}

// Valid cases:
// case3: when it is double read, and both advanced visibility are available, and read mode is from destination
if v.readModeIsFromDestination(domain) {
return v.sourceVisibilityManager
}
// case4: when it is double read, and both advanced visibility are available, and read mode is from source
// case3: when it is double read, and both advanced visibility are available, and read mode is from source
// we first check readModeIsFromSource since we use this flag to control which is the primary visibility manager
if v.readModeIsFromSource(domain) {
return v.destinationVisibilityManager
}

// case4: when it is double read, and both advanced visibility are available, and read mode is from destination
// normally readModeIsFromDestination will always be true when it is in the migration mode
if v.readModeIsFromDestination(domain) {
return v.sourceVisibilityManager
}
// exclude all other cases
return nil
}
Expand Down

0 comments on commit dfe87ab

Please sign in to comment.