[v11.2.x] QuotaService: refactor to use ReplDB for Get queries (#92285)
QuotaService: refactor to use ReplDB for Get queries (#91333)
* Feature (quota service): Use ReplDB for quota service Gets
This adds the replDB to the quota service, as well as some more test helper functions to simplify updating tests. My intent is that the helper functions can be removed when this is fully rolled out (or not) and we're consistently using the ReplDB interface (or not!)
* test updates
(cherry picked from commit 299c142f6a)
Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
This commit is contained in:
co-authored by
Kristin Laemmert
parent
df4dab6846
commit
1247fba905
@@ -264,3 +264,14 @@ func newReplStore(primary *SQLStore, readReplicas ...*SQLStore) *ReplStore {
|
||||
ret.repls = readReplicas
|
||||
return ret
|
||||
}
|
||||
|
||||
// FakeReplStoreFromStore returns a ReplStore with the given primary
|
||||
// SQLStore and no read replicas. This is a bare-minimum wrapper for testing,
|
||||
// and should be removed when all services are using ReplStore in favor of
|
||||
// InitTestReplDB.
|
||||
func FakeReplStoreFromStore(primary *SQLStore) *ReplStore {
|
||||
return &ReplStore{
|
||||
SQLStore: primary,
|
||||
next: 0,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user