@startuml start :Router sends request: Version DB{TS10}; if (DSS has matching entry DB{TS10} AND\nCritical Section is not active) then (YES) #palegreen:Serve the request; stop (NO) elseif ( Am I secondary?\n[!canAcceptNonLocalWrites(..)]) then (YES) :Wait until replication has applied until T10 [waitUntilOpTimeForRead(..)]; else (NO) endif if (Critical Section taken?) then (YES) :Wait until critical section is released [waitForCriticalSectionToComplete(..)]; else (NO) endif switch (compare against DSS entry) case (DSS has matching entry\nDB{TS10}) #palegreen:Serve the request; stop case (DSS has a newer entry. \nDB{TS12}) #yellow:Send Router stale; stop case (DSS has no entry) #pink:Consider split brain handling\nfor primary; #yellow:Send Router stale; stop case (DSS has older entry\nDB{TS7}) #pink:Consider split brain handling\nfor primary; #red: ASSERT(Not Possible); end @enduml