Merge ~cjwatson/launchpad:rename-slave-store into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: e7f8ce7f6fa1fbacf82a518ce805e4720d4fc63e
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:rename-slave-store
Merge into: launchpad:master
Diff against target: 1495 lines (+201/-197)
47 files modified
cronscripts/librarian-feed-swift.py (+3/-3)
cronscripts/translations-export-to-branch.py (+1/-1)
lib/lp/app/stories/basics/xx-dbpolicy.txt (+32/-29)
lib/lp/bugs/scripts/bugtasktargetnamecaches.py (+2/-2)
lib/lp/buildmaster/model/builder.py (+2/-2)
lib/lp/code/model/branchcloud.py (+3/-3)
lib/lp/code/model/tests/test_branchcloud.py (+3/-2)
lib/lp/registry/scripts/teamparticipation.py (+3/-3)
lib/lp/services/database/doc/db-policy.txt (+2/-2)
lib/lp/services/database/doc/storm-store-reset.txt (+1/-1)
lib/lp/services/database/doc/storm.txt (+17/-17)
lib/lp/services/database/interfaces.py (+2/-2)
lib/lp/services/database/policy.py (+2/-2)
lib/lp/services/database/tests/test_bulk.py (+9/-9)
lib/lp/services/database/transaction_policy.py (+2/-2)
lib/lp/services/librarian/tests/test_client.py (+2/-2)
lib/lp/services/librarianserver/swift.py (+3/-3)
lib/lp/services/oauth/model.py (+1/-1)
lib/lp/services/session/adapters.py (+4/-4)
lib/lp/services/session/configure.zcml (+1/-1)
lib/lp/services/session/tests/test_session.py (+2/-2)
lib/lp/services/webapp/adapter.py (+3/-3)
lib/lp/services/webapp/batching.py (+2/-2)
lib/lp/services/webapp/database.zcml (+2/-2)
lib/lp/services/webapp/doc/test_adapter_permissions.txt (+1/-1)
lib/lp/services/webapp/publication.py (+1/-1)
lib/lp/services/webapp/tests/test_dbpolicy.py (+47/-47)
lib/lp/services/worlddata/model/language.py (+2/-2)
lib/lp/soyuz/model/archive.py (+2/-2)
lib/lp/soyuz/tests/test_archive.py (+1/-1)
lib/lp/testing/factory.py (+1/-1)
lib/lp/translations/doc/poexport-request.txt (+1/-1)
lib/lp/translations/doc/poexportqueue-replication-lag.txt (+2/-2)
lib/lp/translations/doc/potmsgset.txt (+1/-1)
lib/lp/translations/interfaces/poexportrequest.py (+1/-1)
lib/lp/translations/interfaces/potmsgset.py (+2/-2)
lib/lp/translations/model/poexportrequest.py (+7/-7)
lib/lp/translations/model/potmsgset.py (+1/-1)
lib/lp/translations/model/translationgroup.py (+3/-3)
lib/lp/translations/model/translationimportqueue.py (+5/-5)
lib/lp/translations/model/vpoexport.py (+1/-1)
lib/lp/translations/scripts/tests/test_translations_to_branch.py (+4/-4)
lib/lp/translations/scripts/translations_to_branch.py (+2/-2)
lib/lp/translations/tests/test_autoapproval.py (+2/-2)
lib/lp/translations/tests/test_translationimportqueue.py (+6/-6)
scripts/get-stacked-on-branches.py (+2/-2)
utilities/soyuz-sampledata-setup.py (+2/-2)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+414253@code.launchpad.net

Commit message

Rename ISlaveStore to IStandbyStore

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cronscripts/librarian-feed-swift.py b/cronscripts/librarian-feed-swift.py
2index ae60177..1cb1374 100755
3--- a/cronscripts/librarian-feed-swift.py
4+++ b/cronscripts/librarian-feed-swift.py
5@@ -11,7 +11,7 @@ import os
6
7 import six
8
9-from lp.services.database.interfaces import ISlaveStore
10+from lp.services.database.interfaces import IStandbyStore
11 from lp.services.librarian.model import LibraryFileContent
12 from lp.services.librarianserver import swift
13 from lp.services.scripts.base import LaunchpadCronScript
14@@ -75,14 +75,14 @@ class LibrarianFeedSwift(LaunchpadCronScript):
15 remove = None
16
17 if self.options.start_since:
18- self.options.start = ISlaveStore(LibraryFileContent).execute("""
19+ self.options.start = IStandbyStore(LibraryFileContent).execute("""
20 SELECT MAX(id) FROM LibraryFileContent
21 WHERE datecreated < current_timestamp at time zone 'UTC'
22 - CAST(%s AS INTERVAL)
23 """, (six.text_type(self.options.start_since),)).get_one()[0]
24
25 if self.options.end_at:
26- self.options.end = ISlaveStore(LibraryFileContent).execute("""
27+ self.options.end = IStandbyStore(LibraryFileContent).execute("""
28 SELECT MAX(id) FROM LibraryFileContent
29 WHERE datecreated < current_timestamp at time zone 'UTC'
30 - CAST(%s AS INTERVAL)
31diff --git a/cronscripts/translations-export-to-branch.py b/cronscripts/translations-export-to-branch.py
32index 308c693..ca5d1dd 100755
33--- a/cronscripts/translations-export-to-branch.py
34+++ b/cronscripts/translations-export-to-branch.py
35@@ -10,7 +10,7 @@ access hosted branches.
36
37 Besides committing to branches, the script updates Branch records in the
38 database, to let the branch scanner know that the branches' contents
39-have been updated. For the rest, the script talks to the slave store.
40+have been updated. For the rest, the script talks to the standby store.
41 """
42
43 __all__ = []
44diff --git a/lib/lp/app/stories/basics/xx-dbpolicy.txt b/lib/lp/app/stories/basics/xx-dbpolicy.txt
45index b0b8e21..c4ffa89 100644
46--- a/lib/lp/app/stories/basics/xx-dbpolicy.txt
47+++ b/lib/lp/app/stories/basics/xx-dbpolicy.txt
48@@ -4,11 +4,11 @@ Application Server Database Policy
49 The database policy chooses the default Storm store to used. Its goal
50 is to distribute load away from the master databases to read only
51 stores where possible. It will benefit old code - new code should
52-explicitly select objects from the master or slave stores as needed.
53+explicitly select objects from the master or standby stores as needed.
54
55-To test this policy, lets point the MAIN SLAVE store to a Launchpad
56+To test this policy, lets point the MAIN STANDBY store to a Launchpad
57 database with a different name. This makes it easy to check if a
58-request is querying the master or slave database.
59+request is querying the master or standby database.
60
61 >>> from lp.services.config import config
62 >>> from textwrap import dedent
63@@ -19,21 +19,24 @@ request is querying the master or slave database.
64 >>> config.push('empty_standby', config_overlay)
65
66 >>> from lp.registry.model.person import Person
67- >>> from lp.services.database.interfaces import IMasterStore, ISlaveStore
68+ >>> from lp.services.database.interfaces import (
69+ ... IMasterStore,
70+ ... IStandbyStore,
71+ ... )
72 >>> from lp.testing.layers import DatabaseLayer
73 >>> master = IMasterStore(Person)
74 >>> dbname = DatabaseLayer._db_fixture.dbname
75 >>> dbname == master.execute("SELECT current_database()").get_one()[0]
76 True
77- >>> slave = ISlaveStore(Person)
78- >>> print(slave.execute("SELECT current_database()").get_one()[0])
79+ >>> standby = IStandbyStore(Person)
80+ >>> print(standby.execute("SELECT current_database()").get_one()[0])
81 launchpad_empty
82
83 We should confirm that the empty database is as empty as we hope it is.
84
85- >>> slave_store = ISlaveStore(Person)
86+ >>> standby_store = IStandbyStore(Person)
87 >>> master_store = IMasterStore(Person)
88- >>> slave_store.find(Person).is_empty()
89+ >>> standby_store.find(Person).is_empty()
90 True
91 >>> master_store.find(Person).is_empty()
92 False
93@@ -46,16 +49,16 @@ needs to be created externally to this pagetest).
94 ... if dbname == DatabaseLayer._db_fixture.dbname:
95 ... return 'MASTER'
96 ... elif dbname == 'launchpad_empty':
97- ... return 'SLAVE'
98+ ... return 'STANDBY'
99 ... else:
100 ... return 'UNKNOWN'
101
102-Read only requests such as GET and HEAD will use the MAIN SLAVE
103+Read only requests such as GET and HEAD will use the MAIN STANDBY
104 Store by default.
105
106 >>> browser.open('http://launchpad.test/+whichdb')
107 >>> print(whichdb(browser))
108- SLAVE
109+ STANDBY
110
111 POST requests might make updates, so they use the MAIN MASTER
112 Store by default.
113@@ -66,18 +69,18 @@ Store by default.
114
115 This is an unauthenticated browser. These typically have no session, unless
116 special dispensation has been made. Without a session, subsequent requests
117-will then immediately return to using the SLAVE.
118+will then immediately return to using the STANDBY.
119
120 >>> browser.open('http://launchpad.test/+whichdb')
121 >>> print(whichdb(browser))
122- SLAVE
123+ STANDBY
124
125 However, if the request has a session (that is, is authenticated; or is
126 unauthenticated, but under special dispensation to have a session), once a
127 POST request has been made, further GET and HEAD requests from the same client
128 continue to use the MAIN MASTER Store by default for 5 minutes. This ensures
129 that a user will see any changes they have made immediately, even though the
130-slave databases may lag some time behind the master database.
131+standby databases may lag some time behind the master database.
132
133 >>> browser.addHeader('Authorization', 'Basic mark@example.com:test')
134 >>> browser.getControl('Do Post').click() # POST request
135@@ -88,19 +91,19 @@ slave databases may lag some time behind the master database.
136 MASTER
137
138 GET and HEAD requests from other clients are unaffected though
139-and use the MAIN SLAVE Store by default.
140+and use the MAIN STANDBY Store by default.
141
142 >>> anon_browser.open('http://launchpad.test/+whichdb')
143 >>> print(whichdb(anon_browser))
144- SLAVE
145+ STANDBY
146 >>> admin_browser.open('http://launchpad.test/+whichdb')
147 >>> print(whichdb(admin_browser))
148- SLAVE
149+ STANDBY
150
151 If no more POST requests are made for 5 minutes, GET and HEAD
152-requests will once again be using the MAIN SLAVE store as we
153+requests will once again be using the MAIN STANDBY store as we
154 can assume that any changes made to the master database have
155-propagated to the slaves.
156+propagated to the standbys.
157
158 To test this, first we need to wind forward the database policy's clock.
159
160@@ -119,18 +122,18 @@ To test this, first we need to wind forward the database policy's clock.
161
162 >>> browser.open('http://launchpad.test/+whichdb')
163 >>> print(whichdb(browser))
164- SLAVE
165+ STANDBY
166
167 >>> dbpolicy._now = _original_now # Reset the time machine.
168
169
170-When lag gets too bad, we stop using slave databases. This stops
171+When lag gets too bad, we stop using standby databases. This stops
172 replication oddities from becoming too bad, as well as lightening the load
173-on the slaves allowing them to catch up.
174+on the standbys allowing them to catch up.
175
176 >>> anon_browser.open('http://launchpad.test/+whichdb')
177 >>> print(whichdb(anon_browser))
178- SLAVE
179+ STANDBY
180
181 >>> dbpolicy._test_lag = timedelta(minutes=10)
182 >>> anon_browser.open('http://launchpad.test/+whichdb')
183@@ -139,7 +142,7 @@ on the slaves allowing them to catch up.
184 >>> dbpolicy._test_lag = None
185
186
187-A 404 error page is shown when code raises a LookupError. If a slave
188+A 404 error page is shown when code raises a LookupError. If a standby
189 database is being used, this might have been caused by replication lag
190 if the missing data was only recently created. To fix this surprising
191 error, requests are always retried using the master database before
192@@ -148,12 +151,12 @@ returning a 404 error to the user.
193 >>> anon_browser.handleErrors = True
194 >>> anon_browser.raiseHttpErrors = False
195
196- # Confirm requests are going to the SLAVE
197+ # Confirm requests are going to the STANDBY
198 >>> anon_browser.open('http://launchpad.test/+whichdb')
199 >>> print(whichdb(anon_browser))
200- SLAVE
201+ STANDBY
202
203- # The slave database contains no data, but we don't get
204+ # The standby database contains no data, but we don't get
205 # a 404 page - the request is retried against the MASTER.
206 >>> anon_browser.open('http://launchpad.test/~stub')
207 >>> anon_browser.headers['Status']
208@@ -165,10 +168,10 @@ returning a 404 error to the user.
209 >>> anon_browser.headers['Status']
210 '404 Not Found'
211
212- # This session is still using the SLAVE though by default.
213+ # This session is still using the STANDBY though by default.
214 >>> anon_browser.open('http://launchpad.test/+whichdb')
215 >>> print(whichdb(anon_browser))
216- SLAVE
217+ STANDBY
218
219 Reset our config to avoid affecting other tests.
220
221diff --git a/lib/lp/bugs/scripts/bugtasktargetnamecaches.py b/lib/lp/bugs/scripts/bugtasktargetnamecaches.py
222index d6cc18d..3d741fc 100644
223--- a/lib/lp/bugs/scripts/bugtasktargetnamecaches.py
224+++ b/lib/lp/bugs/scripts/bugtasktargetnamecaches.py
225@@ -21,7 +21,7 @@ from lp.registry.model.productseries import ProductSeries
226 from lp.registry.model.sourcepackagename import SourcePackageName
227 from lp.services.database.interfaces import (
228 IMasterStore,
229- ISlaveStore,
230+ IStandbyStore,
231 )
232 from lp.services.looptuner import (
233 ITunableLoop,
234@@ -62,7 +62,7 @@ class BugTaskTargetNameCachesTunableLoop:
235 Returns a list of (target, set_of_cached_names) pairs, where target is
236 a tuple of IDs from the columns in target_columns.
237 """
238- store = ISlaveStore(BugTask)
239+ store = IStandbyStore(BugTask)
240 candidate_set = store.find(target_columns).config(distinct=True)
241 candidates = defaultdict(set)
242 for candidate in candidate_set:
243diff --git a/lib/lp/buildmaster/model/builder.py b/lib/lp/buildmaster/model/builder.py
244index eeef109..1fd92ec 100644
245--- a/lib/lp/buildmaster/model/builder.py
246+++ b/lib/lp/buildmaster/model/builder.py
247@@ -50,7 +50,7 @@ from lp.services.database.constants import UTC_NOW
248 from lp.services.database.decoratedresultset import DecoratedResultSet
249 from lp.services.database.enumcol import DBEnum
250 from lp.services.database.interfaces import (
251- ISlaveStore,
252+ IStandbyStore,
253 IStore,
254 )
255 from lp.services.database.stormbase import StormBase
256@@ -300,7 +300,7 @@ class BuilderSet:
257
258 def getBuildQueueSizes(self):
259 """See `IBuilderSet`."""
260- results = ISlaveStore(BuildQueue).find((
261+ results = IStandbyStore(BuildQueue).find((
262 Count(),
263 Sum(BuildQueue.estimated_duration),
264 Processor,
265diff --git a/lib/lp/code/model/branchcloud.py b/lib/lp/code/model/branchcloud.py
266index e6969f3..000a1ad 100644
267--- a/lib/lp/code/model/branchcloud.py
268+++ b/lib/lp/code/model/branchcloud.py
269@@ -29,7 +29,7 @@ from zope.interface import provider
270 from lp.code.interfaces.branch import IBranchCloud
271 from lp.code.model.revision import RevisionCache
272 from lp.registry.model.product import Product
273-from lp.services.database.interfaces import ISlaveStore
274+from lp.services.database.interfaces import IStandbyStore
275
276
277 @provider(IBranchCloud)
278@@ -44,8 +44,8 @@ class BranchCloud:
279 commits = Alias(Count(RevisionCache.revision_id))
280 epoch = datetime.now(pytz.UTC) - timedelta(days=30)
281 # It doesn't matter if this query is even a whole day out of date, so
282- # use the slave store.
283- result = ISlaveStore(RevisionCache).find(
284+ # use the standby store.
285+ result = IStandbyStore(RevisionCache).find(
286 (Product.name,
287 commits,
288 Count(distinct_revision_author),
289diff --git a/lib/lp/code/model/tests/test_branchcloud.py b/lib/lp/code/model/tests/test_branchcloud.py
290index 4fb7143..2af246f 100644
291--- a/lib/lp/code/model/tests/test_branchcloud.py
292+++ b/lib/lp/code/model/tests/test_branchcloud.py
293@@ -37,8 +37,9 @@ class TestBranchCloud(TestCaseWithFactory):
294
295 def getProductsWithInfo(self, num_products=None):
296 """Get product cloud information."""
297- # Since we use the slave store to get the information, we need to
298- # commit the transaction to make the information visible to the slave.
299+ # Since we use the standby store to get the information, we need to
300+ # commit the transaction to make the information visible to the
301+ # standby.
302 transaction.commit()
303 cloud_info = self._branch_cloud.getProductsWithInfo(num_products)
304
305diff --git a/lib/lp/registry/scripts/teamparticipation.py b/lib/lp/registry/scripts/teamparticipation.py
306index cfca76a..cb15dff 100644
307--- a/lib/lp/registry/scripts/teamparticipation.py
308+++ b/lib/lp/registry/scripts/teamparticipation.py
309@@ -30,7 +30,7 @@ from lp.registry.interfaces.teammembership import ACTIVE_STATES
310 from lp.registry.model.teammembership import TeamParticipation
311 from lp.services.database.interfaces import (
312 IMasterStore,
313- ISlaveStore,
314+ IStandbyStore,
315 )
316 from lp.services.database.sqlbase import (
317 quote,
318@@ -52,7 +52,7 @@ def check_teamparticipation_circular(log):
319 AND tp.person = tp2.team
320 AND tp.id != tp2.id;
321 """
322- circular_references = list(ISlaveStore(TeamParticipation).execute(query))
323+ circular_references = list(IStandbyStore(TeamParticipation).execute(query))
324 if len(circular_references) > 0:
325 raise LaunchpadScriptFailure(
326 "Circular references found: %s" % circular_references)
327@@ -93,7 +93,7 @@ def execute_long_query(store, log, interval, query):
328 def fetch_team_participation_info(log):
329 """Fetch people, teams, memberships and participations."""
330 slurp = partial(
331- execute_long_query, ISlaveStore(TeamParticipation), log, 10000)
332+ execute_long_query, IStandbyStore(TeamParticipation), log, 10000)
333
334 people = dict(
335 slurp(
336diff --git a/lib/lp/services/database/doc/db-policy.txt b/lib/lp/services/database/doc/db-policy.txt
337index 8a1cce2..fbb9aae 100644
338--- a/lib/lp/services/database/doc/db-policy.txt
339+++ b/lib/lp/services/database/doc/db-policy.txt
340@@ -31,8 +31,8 @@ of the primary, the better the overall performance of Launchpad will be.
341 We can distribute this load over many standby databases but are limited to
342 a single primary.
343
344- >>> from lp.services.database.interfaces import ISlaveStore
345- >>> ro_janitor = ISlaveStore(Person).find(
346+ >>> from lp.services.database.interfaces import IStandbyStore
347+ >>> ro_janitor = IStandbyStore(Person).find(
348 ... Person, Person.name == 'janitor').one()
349 >>> ro_janitor is writable_janitor
350 False
351diff --git a/lib/lp/services/database/doc/storm-store-reset.txt b/lib/lp/services/database/doc/storm-store-reset.txt
352index 8380370..b22a9a6 100644
353--- a/lib/lp/services/database/doc/storm-store-reset.txt
354+++ b/lib/lp/services/database/doc/storm-store-reset.txt
355@@ -28,7 +28,7 @@ we rely on that to find out whether or not to reset stores.
356 ... http = setupBrowser(auth="Basic foo.bar@canonical.com:test")
357 ... http.open("http://launchpad.test/~salgado/+edit")
358 ... http.getControl("Display Name").value = "Changed"
359- ... # Need a POST or the DB policy will be using the slave.
360+ ... # Need a POST or the DB policy will be using the standby.
361 ... http.getControl("Save Changes").click()
362 ... alive_items = len(IStore(Person)._alive)
363
364diff --git a/lib/lp/services/database/doc/storm.txt b/lib/lp/services/database/doc/storm.txt
365index 82823a5..2690d05 100644
366--- a/lib/lp/services/database/doc/storm.txt
367+++ b/lib/lp/services/database/doc/storm.txt
368@@ -4,7 +4,7 @@ back into the main replication set as part of login server separation.
369 -- StuartBishop 20100222
370
371 In addition to what Storm provides, we also have some Launchpad
372-specific Storm tools to cope with our master and slave store arrangement.
373+specific Storm tools to cope with our master and standby store arrangement.
374
375 >>> from lp.services.identity.interfaces.emailaddress import (
376 ... EmailAddressStatus,
377@@ -13,7 +13,7 @@ specific Storm tools to cope with our master and slave store arrangement.
378 >>> from lp.services.database.interfaces import (
379 ... IMasterObject,
380 ... IMasterStore,
381- ... ISlaveStore,
382+ ... IStandbyStore,
383 ... IStore,
384 ... )
385 >>> from lp.services.identity.model.emailaddress import EmailAddress
386@@ -33,33 +33,33 @@ provides.
387
388 >>> IMasterStore.providedBy(main_master)
389 True
390- >>> ISlaveStore.providedBy(main_master)
391+ >>> IStandbyStore.providedBy(main_master)
392 False
393
394
395-Changes to the slave Stores will lag behind the master Stores. If
396+Changes to the standby Stores will lag behind the master Stores. If
397 you only need to read an object but require it to be in sync with the
398 master, you should use the default Store. Launchpad will give you the
399-slave store if it is sure all your recent changes have been replicated.
400+standby store if it is sure all your recent changes have been replicated.
401 Otherwise, it gives you the master. See IStoreSelector for details.
402
403 >>> main_default = IStore(Person)
404- >>> main_slave = ISlaveStore(Person)
405+ >>> main_standby = IStandbyStore(Person)
406 >>> main_default is main_master
407 True
408- >>> main_default is main_slave
409+ >>> main_default is main_standby
410 False
411
412
413 You can also adapt database object instances to Stores, although
414 this is less generally useful.
415
416- >>> janitor = ISlaveStore(Person).find(Person, name='janitor').one()
417- >>> ISlaveStore(janitor) is ISlaveStore(Person)
418+ >>> janitor = IStandbyStore(Person).find(Person, name='janitor').one()
419+ >>> IStandbyStore(janitor) is IStandbyStore(Person)
420 True
421 >>> IMasterStore(janitor) is IMasterStore(Person)
422 True
423- >>> IMasterStore(janitor) is ISlaveStore(Person)
424+ >>> IMasterStore(janitor) is IStandbyStore(Person)
425 False
426
427
428@@ -68,9 +68,9 @@ Good defensive programming is to use this adapter if you want to make
429 changes to an object, just in case you have been passed an instance
430 from a store other than the correct Master.
431
432- >>> main_slave = ISlaveStore(Person)
433+ >>> main_standby = IStandbyStore(Person)
434 >>> t = transaction.begin()
435- >>> person = main_slave.find(Person, name='mark').one()
436+ >>> person = main_standby.find(Person, name='mark').one()
437 >>> person.display_name = 'Cannot change'
438 >>> transaction.commit()
439 Traceback (most recent call last):
440@@ -79,7 +79,7 @@ from a store other than the correct Master.
441
442 >>> transaction.abort()
443 >>> t = transaction.begin()
444- >>> person = main_slave.find(Person, name='mark').one()
445+ >>> person = main_standby.find(Person, name='mark').one()
446 >>> IMasterObject(person).display_name = 'Can change'
447 >>> transaction.commit()
448
449@@ -121,14 +121,14 @@ stores.
450 >>> master_email = IMasterStore(EmailAddress).find(
451 ... EmailAddress, Person.name == 'janitor',
452 ... EmailAddress.person==Person.id).one()
453- >>> slave_email = ISlaveStore(EmailAddress).find(
454+ >>> standby_email = IStandbyStore(EmailAddress).find(
455 ... EmailAddress, Person.name == 'janitor',
456 ... EmailAddress.person==Person.id).one()
457- >>> master_email is slave_email
458+ >>> master_email is standby_email
459 False
460- >>> master_email == slave_email
461+ >>> master_email == standby_email
462 True
463- >>> master_email != slave_email
464+ >>> master_email != standby_email
465 False
466
467 Comparison works for security wrapped objects too.
468diff --git a/lib/lp/services/database/interfaces.py b/lib/lp/services/database/interfaces.py
469index 5e89515..aae6350 100644
470--- a/lib/lp/services/database/interfaces.py
471+++ b/lib/lp/services/database/interfaces.py
472@@ -9,8 +9,8 @@ __all__ = [
473 'IMasterObject',
474 'IMasterStore',
475 'IRequestExpired',
476- 'ISlaveStore',
477 'ISQLBase',
478+ 'IStandbyStore',
479 'IStore',
480 'IStoreSelector',
481 'MAIN_STORE',
482@@ -153,7 +153,7 @@ class IMasterStore(IStore):
483 """A writeable Storm Stores."""
484
485
486-class ISlaveStore(IStore):
487+class IStandbyStore(IStore):
488 """A read-only Storm Store."""
489
490
491diff --git a/lib/lp/services/database/policy.py b/lib/lp/services/database/policy.py
492index a50fe3d..8d8f4e3 100644
493--- a/lib/lp/services/database/policy.py
494+++ b/lib/lp/services/database/policy.py
495@@ -44,7 +44,7 @@ from lp.services.database.interfaces import (
496 DisallowedStore,
497 IDatabasePolicy,
498 IMasterStore,
499- ISlaveStore,
500+ IStandbyStore,
501 IStoreSelector,
502 MAIN_STORE,
503 PRIMARY_FLAVOR,
504@@ -158,7 +158,7 @@ class BaseDatabasePolicy:
505 if flavor == PRIMARY_FLAVOR:
506 alsoProvides(store, IMasterStore)
507 else:
508- alsoProvides(store, ISlaveStore)
509+ alsoProvides(store, IStandbyStore)
510
511 store._lp_store_initialized = True
512
513diff --git a/lib/lp/services/database/tests/test_bulk.py b/lib/lp/services/database/tests/test_bulk.py
514index a90d11e..78981ae 100644
515--- a/lib/lp/services/database/tests/test_bulk.py
516+++ b/lib/lp/services/database/tests/test_bulk.py
517@@ -30,7 +30,7 @@ from lp.registry.model.person import Person
518 from lp.services.database import bulk
519 from lp.services.database.interfaces import (
520 IMasterStore,
521- ISlaveStore,
522+ IStandbyStore,
523 IStore,
524 )
525 from lp.services.database.sqlbase import (
526@@ -131,13 +131,13 @@ class TestLoaders(TestCaseWithFactory):
527 db_object = self.factory.makeComponent()
528 db_object_type = bulk.get_type(db_object)
529 # Commit so the database object is available in both master
530- # and slave stores.
531+ # and standby stores.
532 transaction.commit()
533 # Use a list, since objects corresponding to the same DB row from
534 # different stores compare equal.
535 db_objects = [
536 IMasterStore(db_object).get(db_object_type, db_object.id),
537- ISlaveStore(db_object).get(db_object_type, db_object.id),
538+ IStandbyStore(db_object).get(db_object_type, db_object.id),
539 ]
540 db_object_ids = {id(obj) for obj in db_objects}
541 db_queries = list(bulk.gen_reload_queries(db_objects))
542@@ -234,7 +234,7 @@ class TestLoaders(TestCaseWithFactory):
543 # load() can use an alternative store.
544 db_object = self.factory.makeComponent()
545 # Commit so the database object is available in both master
546- # and slave stores.
547+ # and standby stores.
548 transaction.commit()
549 # Master store.
550 master_store = IMasterStore(db_object)
551@@ -242,12 +242,12 @@ class TestLoaders(TestCaseWithFactory):
552 Component, [db_object.id], store=master_store)
553 self.assertEqual(
554 Store.of(db_object_from_master), master_store)
555- # Slave store.
556- slave_store = ISlaveStore(db_object)
557- [db_object_from_slave] = bulk.load(
558- Component, [db_object.id], store=slave_store)
559+ # Standby store.
560+ standby_store = IStandbyStore(db_object)
561+ [db_object_from_standby] = bulk.load(
562+ Component, [db_object.id], store=standby_store)
563 self.assertEqual(
564- Store.of(db_object_from_slave), slave_store)
565+ Store.of(db_object_from_standby), standby_store)
566
567 def test_load_related(self):
568 owning_objects = [
569diff --git a/lib/lp/services/database/transaction_policy.py b/lib/lp/services/database/transaction_policy.py
570index bb1b403..8766894 100644
571--- a/lib/lp/services/database/transaction_policy.py
572+++ b/lib/lp/services/database/transaction_policy.py
573@@ -24,7 +24,7 @@ class DatabaseTransactionPolicy:
574
575 # We want to be sure that inspect_data does not inadvertently
576 # make any changes in the database, but we can't run it on the
577- # slave store because it doesn't tolerate replication lag.
578+ # standby store because it doesn't tolerate replication lag.
579 with DatabaseTransactionPolicy(read_only=True):
580 inspect_data()
581
582@@ -69,7 +69,7 @@ class DatabaseTransactionPolicy:
583 writability of database transactions.
584
585 :param store: The store to set policy on. Defaults to the main master
586- store. You don't want to use this on a slave store!
587+ store. You don't want to use this on a standby store!
588 :param read_only: Is this policy read-only?
589 """
590 self.read_only = read_only
591diff --git a/lib/lp/services/librarian/tests/test_client.py b/lib/lp/services/librarian/tests/test_client.py
592index cb054a9..6bef538 100644
593--- a/lib/lp/services/librarian/tests/test_client.py
594+++ b/lib/lp/services/librarian/tests/test_client.py
595@@ -25,7 +25,7 @@ import transaction
596
597 from lp.services.config import config
598 from lp.services.daemons.tachandler import TacTestSetup
599-from lp.services.database.interfaces import ISlaveStore
600+from lp.services.database.interfaces import IStandbyStore
601 from lp.services.database.policy import StandbyDatabasePolicy
602 from lp.services.database.sqlbase import block_implicit_flushes
603 from lp.services.librarian import client as client_module
604@@ -299,7 +299,7 @@ class LibrarianClientTestCase(TestCase):
605 # standby store and try to add a file, verifying that the primary
606 # is used.
607 client = LibrarianClient()
608- ISlaveStore(LibraryFileAlias).close()
609+ IStandbyStore(LibraryFileAlias).close()
610 with StandbyDatabasePolicy():
611 alias_id = client.addFile(
612 'sample.txt', 6, io.BytesIO(b'sample'), 'text/plain')
613diff --git a/lib/lp/services/librarianserver/swift.py b/lib/lp/services/librarianserver/swift.py
614index 637110f..ddb3125 100644
615--- a/lib/lp/services/librarianserver/swift.py
616+++ b/lib/lp/services/librarianserver/swift.py
617@@ -24,7 +24,7 @@ from six.moves.urllib.parse import quote
618 from swiftclient import client as swiftclient
619
620 from lp.services.config import config
621-from lp.services.database.interfaces import ISlaveStore
622+from lp.services.database.interfaces import IStandbyStore
623 from lp.services.librarian.model import LibraryFileContent
624
625
626@@ -143,7 +143,7 @@ def to_swift(log, start_lfc_id=None, end_lfc_id=None,
627
628 log.debug('Found {} ({})'.format(lfc, filename))
629
630- if ISlaveStore(LibraryFileContent).get(
631+ if IStandbyStore(LibraryFileContent).get(
632 LibraryFileContent, lfc) is None:
633 log.info("{} exists on disk but not in the db".format(
634 lfc))
635@@ -205,7 +205,7 @@ def _put(log, swift_connection, lfc_id, container, obj_name, fs_path):
636 fs_size = os.path.getsize(fs_path)
637 fs_file = HashStream(open(fs_path, 'rb'))
638
639- db_md5_hash = ISlaveStore(LibraryFileContent).get(
640+ db_md5_hash = IStandbyStore(LibraryFileContent).get(
641 LibraryFileContent, lfc_id).md5
642
643 assert hasattr(fs_file, 'tell') and hasattr(fs_file, 'seek'), '''
644diff --git a/lib/lp/services/oauth/model.py b/lib/lp/services/oauth/model.py
645index 3b48de6..2c07b19 100644
646--- a/lib/lp/services/oauth/model.py
647+++ b/lib/lp/services/oauth/model.py
648@@ -68,7 +68,7 @@ class OAuthBase:
649 """Return the correct store for this class.
650
651 We want all OAuth classes to be retrieved from the master flavour. If
652- they are retrieved from the slave, there will be problems in the
653+ they are retrieved from the standby, there will be problems in the
654 authorization exchange, since it will be done across applications that
655 won't share the session cookies.
656 """
657diff --git a/lib/lp/services/session/adapters.py b/lib/lp/services/session/adapters.py
658index 1cc2767..e2bc15b 100644
659--- a/lib/lp/services/session/adapters.py
660+++ b/lib/lp/services/session/adapters.py
661@@ -11,7 +11,7 @@ from zope.interface import implementer
662
663 from lp.services.database.interfaces import (
664 IMasterStore,
665- ISlaveStore,
666+ IStandbyStore,
667 IStore,
668 )
669 from lp.services.database.sqlbase import session_store
670@@ -26,9 +26,9 @@ def session_master_store(cls):
671
672
673 @adapter(IUseSessionStore)
674-@implementer(ISlaveStore)
675-def session_slave_store(cls):
676- """Adapt a Session database object to an `ISlaveStore`."""
677+@implementer(IStandbyStore)
678+def session_standby_store(cls):
679+ """Adapt a Session database object to an `IStandbyStore`."""
680 return session_store()
681
682
683diff --git a/lib/lp/services/session/configure.zcml b/lib/lp/services/session/configure.zcml
684index dea1cd8..8c3c399 100644
685--- a/lib/lp/services/session/configure.zcml
686+++ b/lib/lp/services/session/configure.zcml
687@@ -7,6 +7,6 @@
688 xmlns:i18n="http://namespaces.zope.org/i18n"
689 i18n_domain="launchpad">
690 <adapter factory=".adapters.session_master_store" />
691- <adapter factory=".adapters.session_slave_store" />
692+ <adapter factory=".adapters.session_standby_store" />
693 <adapter factory=".adapters.session_default_store" />
694 </configure>
695diff --git a/lib/lp/services/session/tests/test_session.py b/lib/lp/services/session/tests/test_session.py
696index 6f5c1c0..10cab73 100644
697--- a/lib/lp/services/session/tests/test_session.py
698+++ b/lib/lp/services/session/tests/test_session.py
699@@ -5,7 +5,7 @@
700
701 from lp.services.database.interfaces import (
702 IMasterStore,
703- ISlaveStore,
704+ IStandbyStore,
705 IStore,
706 )
707 from lp.services.session.model import (
708@@ -20,7 +20,7 @@ class TestSessionModelAdapters(TestCase):
709 layer = DatabaseFunctionalLayer
710
711 def test_adapters(self):
712- for adapter in [IMasterStore, ISlaveStore, IStore]:
713+ for adapter in [IMasterStore, IStandbyStore, IStore]:
714 for cls in [SessionData, SessionPkgData]:
715 for obj in [cls, cls()]:
716 store = adapter(obj)
717diff --git a/lib/lp/services/webapp/adapter.py b/lib/lp/services/webapp/adapter.py
718index 26b4b6d..da15bfa 100644
719--- a/lib/lp/services/webapp/adapter.py
720+++ b/lib/lp/services/webapp/adapter.py
721@@ -750,7 +750,7 @@ class StoreSelector:
722
723
724 # We want to be able to adapt a Storm class to an IStore, IMasterStore or
725-# ISlaveStore. Unfortunately, the component architecture provides no
726+# IStandbyStore. Unfortunately, the component architecture provides no
727 # way for us to declare that a class, and all its subclasses, provides
728 # a given interface. This means we need to use an global adapter.
729
730@@ -768,8 +768,8 @@ def get_master_store(storm_class):
731 return get_store(storm_class, PRIMARY_FLAVOR)
732
733
734-def get_slave_store(storm_class):
735- """Return the master Store for the given database class."""
736+def get_standby_store(storm_class):
737+ """Return the standby Store for the given database class."""
738 return get_store(storm_class, STANDBY_FLAVOR)
739
740
741diff --git a/lib/lp/services/webapp/batching.py b/lib/lp/services/webapp/batching.py
742index 894e6a6..b4c3b2b 100644
743--- a/lib/lp/services/webapp/batching.py
744+++ b/lib/lp/services/webapp/batching.py
745@@ -36,7 +36,7 @@ from zope.security.proxy import (
746 from lp.app.browser.launchpad import iter_view_registrations
747 from lp.services.config import config
748 from lp.services.database.decoratedresultset import DecoratedResultSet
749-from lp.services.database.interfaces import ISlaveStore
750+from lp.services.database.interfaces import IStandbyStore
751 from lp.services.database.sqlbase import (
752 convert_storm_clause_to_string,
753 sqlvalues,
754@@ -621,7 +621,7 @@ class StormRangeFactory:
755 select = removeSecurityProxy(self.plain_resultset).get_select_expr(
756 *columns)
757 explain = 'EXPLAIN ' + convert_storm_clause_to_string(select)
758- result = ISlaveStore(LibraryFileAlias).execute(explain)
759+ result = IStandbyStore(LibraryFileAlias).execute(explain)
760 _rows_re = re.compile(r"rows=(\d+)\swidth=")
761 first_line = result.get_one()[0]
762 match = _rows_re.search(first_line)
763diff --git a/lib/lp/services/webapp/database.zcml b/lib/lp/services/webapp/database.zcml
764index 2d9fcd1..c283ee1 100644
765--- a/lib/lp/services/webapp/database.zcml
766+++ b/lib/lp/services/webapp/database.zcml
767@@ -46,9 +46,9 @@
768 factory="lp.services.webapp.adapter.get_master_store"
769 />
770 <adapter
771- provides="lp.services.database.interfaces.ISlaveStore"
772+ provides="lp.services.database.interfaces.IStandbyStore"
773 for="zope.interface.Interface"
774- factory="lp.services.webapp.adapter.get_slave_store"
775+ factory="lp.services.webapp.adapter.get_standby_store"
776 />
777 <!-- Universal adapter needed here per Bug #591841.
778 We have no way of specifying that all subclasses of
779diff --git a/lib/lp/services/webapp/doc/test_adapter_permissions.txt b/lib/lp/services/webapp/doc/test_adapter_permissions.txt
780index 2ae057f..35d35e3 100644
781--- a/lib/lp/services/webapp/doc/test_adapter_permissions.txt
782+++ b/lib/lp/services/webapp/doc/test_adapter_permissions.txt
783@@ -5,7 +5,7 @@ traversed to from a PRIMARY_FLAVOR store.
784 Because our development environment is not replicated, we use database
785 permissions to ensure that tables we should not be writing to cannot
786 be written to. The same permissions structure is also used on production,
787-so the Slony-I triggers blocking writes to some tables will never
788+so the Slony-I triggers blocking writes to replicated tables will never
789 actually be invoked.
790
791 >>> from lp.registry.model.person import Person
792diff --git a/lib/lp/services/webapp/publication.py b/lib/lp/services/webapp/publication.py
793index 31079d6..80effc1 100644
794--- a/lib/lp/services/webapp/publication.py
795+++ b/lib/lp/services/webapp/publication.py
796@@ -703,7 +703,7 @@ class LaunchpadBrowserPublication(
797 return False
798
799 # If we get a LookupError and the default database being
800- # used is a replica, raise a Retry exception instead of
801+ # used is a standby, raise a Retry exception instead of
802 # returning the 404 error page. We do this in case the
803 # LookupError is caused by replication lag. Our database
804 # policy forces the use of the primary database for retries.
805diff --git a/lib/lp/services/webapp/tests/test_dbpolicy.py b/lib/lp/services/webapp/tests/test_dbpolicy.py
806index 8855268..a2a8120 100644
807--- a/lib/lp/services/webapp/tests/test_dbpolicy.py
808+++ b/lib/lp/services/webapp/tests/test_dbpolicy.py
809@@ -36,7 +36,7 @@ from lp.services.database.interfaces import (
810 DisallowedStore,
811 IDatabasePolicy,
812 IMasterStore,
813- ISlaveStore,
814+ IStandbyStore,
815 IStoreSelector,
816 MAIN_STORE,
817 PRIMARY_FLAVOR,
818@@ -110,7 +110,7 @@ class StandbyDatabasePolicyTestCase(BaseDatabasePolicyTestCase):
819 for store in ALL_STORES:
820 self.assertProvides(
821 getUtility(IStoreSelector).get(store, DEFAULT_FLAVOR),
822- ISlaveStore)
823+ IStandbyStore)
824
825 def test_primary_allowed(self):
826 for store in ALL_STORES:
827@@ -157,7 +157,7 @@ class PrimaryDatabasePolicyTestCase(BaseDatabasePolicyTestCase):
828 for store in ALL_STORES:
829 self.assertProvides(
830 getUtility(IStoreSelector).get(store, STANDBY_FLAVOR),
831- ISlaveStore)
832+ IStandbyStore)
833
834
835 class LaunchpadDatabasePolicyTestCase(StandbyDatabasePolicyTestCase):
836@@ -268,56 +268,56 @@ class PrimaryFallbackTestCase(TestCase):
837 '''Confirm that this TestCase's test infrastructure works as needed.
838 '''
839 master_store = IMasterStore(Person)
840- slave_store = ISlaveStore(Person)
841+ standby_store = IStandbyStore(Person)
842
843 # Both Stores work when pgbouncer is up.
844 master_store.get(Person, 1)
845- slave_store.get(Person, 1)
846+ standby_store.get(Person, 1)
847
848- # Slave Store breaks when pgbouncer is torn down. Master Store
849+ # Standby Store breaks when pgbouncer is torn down. Master Store
850 # is fine.
851 self.pgbouncer_fixture.stop()
852 master_store.get(Person, 2)
853- self.assertRaises(DisconnectionError, slave_store.get, Person, 2)
854+ self.assertRaises(DisconnectionError, standby_store.get, Person, 2)
855
856 def test_startup_with_no_standby(self):
857 '''An attempt is made for the first time to connect to a standby.'''
858 self.pgbouncer_fixture.stop()
859
860 master_store = IMasterStore(Person)
861- slave_store = ISlaveStore(Person)
862+ standby_store = IStandbyStore(Person)
863
864- # The master and slave Stores are the same object.
865- self.assertIs(master_store, slave_store)
866+ # The master and standby Stores are the same object.
867+ self.assertIs(master_store, standby_store)
868
869 def test_standby_shutdown_during_transaction(self):
870 '''Standby is shutdown while running, but we can recover.'''
871 master_store = IMasterStore(Person)
872- slave_store = ISlaveStore(Person)
873+ standby_store = IStandbyStore(Person)
874
875- self.assertIsNot(master_store, slave_store)
876+ self.assertIsNot(master_store, standby_store)
877
878 self.pgbouncer_fixture.stop()
879
880- # The transaction fails if the slave store is used. Robust
881+ # The transaction fails if the standby store is used. Robust
882 # processes will handle this and retry (even if just means exit
883 # and wait for the next scheduled invocation).
884- self.assertRaises(DisconnectionError, slave_store.get, Person, 1)
885+ self.assertRaises(DisconnectionError, standby_store.get, Person, 1)
886
887 transaction.abort()
888
889 # But in the next transaction, we get the master Store if we ask
890- # for the slave Store so we can continue.
891+ # for the standby Store so we can continue.
892 master_store = IMasterStore(Person)
893- slave_store = ISlaveStore(Person)
894+ standby_store = IStandbyStore(Person)
895
896- self.assertIs(master_store, slave_store)
897+ self.assertIs(master_store, standby_store)
898
899 def test_standby_shutdown_between_transactions(self):
900 '''Standby is shutdown in between transactions.'''
901 master_store = IMasterStore(Person)
902- slave_store = ISlaveStore(Person)
903- self.assertIsNot(master_store, slave_store)
904+ standby_store = IStandbyStore(Person)
905+ self.assertIsNot(master_store, standby_store)
906
907 transaction.abort()
908 self.pgbouncer_fixture.stop()
909@@ -325,31 +325,31 @@ class PrimaryFallbackTestCase(TestCase):
910 # The process doesn't notice the standby going down, and things
911 # will fail the next time the standby is used.
912 master_store = IMasterStore(Person)
913- slave_store = ISlaveStore(Person)
914- self.assertIsNot(master_store, slave_store)
915- self.assertRaises(DisconnectionError, slave_store.get, Person, 1)
916+ standby_store = IStandbyStore(Person)
917+ self.assertIsNot(master_store, standby_store)
918+ self.assertRaises(DisconnectionError, standby_store.get, Person, 1)
919
920 # But now it has been discovered the socket is no longer
921 # connected to anything, next transaction we get a master
922- # Store when we ask for a slave.
923+ # Store when we ask for a standby.
924 master_store = IMasterStore(Person)
925- slave_store = ISlaveStore(Person)
926- self.assertIs(master_store, slave_store)
927+ standby_store = IStandbyStore(Person)
928+ self.assertIs(master_store, standby_store)
929
930 def test_standby_reconnect_after_outage(self):
931 '''The standby is again used once it becomes available.'''
932 self.pgbouncer_fixture.stop()
933
934 master_store = IMasterStore(Person)
935- slave_store = ISlaveStore(Person)
936- self.assertIs(master_store, slave_store)
937+ standby_store = IStandbyStore(Person)
938+ self.assertIs(master_store, standby_store)
939
940 self.pgbouncer_fixture.start()
941 transaction.abort()
942
943 master_store = IMasterStore(Person)
944- slave_store = ISlaveStore(Person)
945- self.assertIsNot(master_store, slave_store)
946+ standby_store = IStandbyStore(Person)
947+ self.assertIsNot(master_store, standby_store)
948
949
950 class TestFastDowntimeRollout(TestCase):
951@@ -401,7 +401,7 @@ class TestFastDowntimeRollout(TestCase):
952 '''You can always access a working standby store during fast downtime.
953 '''
954 # Everything is running happily.
955- store = ISlaveStore(Person)
956+ store = IStandbyStore(Person)
957 original_store = store
958 self.assertTrue(self.store_is_working(store))
959 self.assertTrue(self.store_is_standby(store))
960@@ -437,9 +437,9 @@ class TestFastDowntimeRollout(TestCase):
961 # But if we handle that and retry, we can continue.
962 # Now the failed connection has been detected, the next Store
963 # we are handed is a primary Store instead of a standby.
964- store = ISlaveStore(Person)
965+ store = IStandbyStore(Person)
966 self.assertTrue(self.store_is_primary(store))
967- self.assertIsNot(ISlaveStore(Person), original_store)
968+ self.assertIsNot(IStandbyStore(Person), original_store)
969
970 # But alas, it might not work the first transaction. If it has
971 # been earlier, its connection was killed by pgbouncer earlier
972@@ -449,7 +449,7 @@ class TestFastDowntimeRollout(TestCase):
973
974 # Next retry attempt, everything is fine using the primary
975 # connection, even though our code only asked for a standby.
976- store = ISlaveStore(Person)
977+ store = IStandbyStore(Person)
978 self.assertTrue(self.store_is_primary(store))
979 self.assertTrue(self.store_is_working(store))
980
981@@ -464,7 +464,7 @@ class TestFastDowntimeRollout(TestCase):
982 self.pgbouncer_cur.execute('ENABLE %s' % self.standby_dbname)
983
984 # And next transaction, we are back to normal.
985- store = ISlaveStore(Person)
986+ store = IStandbyStore(Person)
987 self.assertTrue(self.store_is_working(store))
988 self.assertTrue(self.store_is_standby(store))
989 self.assertIs(original_store, store)
990@@ -477,9 +477,9 @@ class TestFastDowntimeRollout(TestCase):
991 self.assertTrue(self.store_is_primary(master_store))
992 self.assertTrue(self.store_is_working(master_store))
993
994- slave_store = ISlaveStore(Person)
995- self.assertTrue(self.store_is_standby(slave_store))
996- self.assertTrue(self.store_is_working(slave_store))
997+ standby_store = IStandbyStore(Person)
998+ self.assertTrue(self.store_is_standby(standby_store))
999+ self.assertTrue(self.store_is_working(standby_store))
1000
1001 # But fast downtime is about to happen.
1002
1003@@ -492,7 +492,7 @@ class TestFastDowntimeRollout(TestCase):
1004 self.pgbouncer_cur.execute('KILL %s' % self.primary_dbname)
1005
1006 # Of course, standby connections are unaffected.
1007- self.assertTrue(self.store_is_working(slave_store))
1008+ self.assertTrue(self.store_is_working(standby_store))
1009
1010 # But attempts to use a primary store will fail.
1011 self.assertFalse(self.store_is_working(master_store))
1012@@ -515,18 +515,18 @@ class TestFastDowntimeRollout(TestCase):
1013
1014 # The next attempt at accessing the standby store will fail
1015 # with a DisconnectionError.
1016- slave_store = ISlaveStore(Person)
1017- self.assertTrue(self.store_is_standby(slave_store))
1018+ standby_store = IStandbyStore(Person)
1019+ self.assertTrue(self.store_is_standby(standby_store))
1020 self.assertRaises(
1021- DisconnectionError, slave_store.execute, 'SELECT TRUE')
1022+ DisconnectionError, standby_store.execute, 'SELECT TRUE')
1023 transaction.abort()
1024
1025 # But if we handle that and retry, we can continue.
1026 # Now the failed connection has been detected, the next Store
1027 # we are handed is a primary Store instead of a standby.
1028- slave_store = ISlaveStore(Person)
1029- self.assertTrue(self.store_is_primary(slave_store))
1030- self.assertTrue(self.store_is_working(slave_store))
1031+ standby_store = IStandbyStore(Person)
1032+ self.assertTrue(self.store_is_primary(standby_store))
1033+ self.assertTrue(self.store_is_working(standby_store))
1034
1035 # Once replication has caught up, the standby is reenabled.
1036 self.pgbouncer_cur.execute('RESUME %s' % self.standby_dbname)
1037@@ -538,6 +538,6 @@ class TestFastDowntimeRollout(TestCase):
1038 self.assertTrue(self.store_is_primary(master_store))
1039 self.assertTrue(self.store_is_working(master_store))
1040
1041- slave_store = ISlaveStore(Person)
1042- self.assertTrue(self.store_is_standby(slave_store))
1043- self.assertTrue(self.store_is_working(slave_store))
1044+ standby_store = IStandbyStore(Person)
1045+ self.assertTrue(self.store_is_standby(standby_store))
1046+ self.assertTrue(self.store_is_working(standby_store))
1047diff --git a/lib/lp/services/worlddata/model/language.py b/lib/lp/services/worlddata/model/language.py
1048index aaff902..d4af9d6 100644
1049--- a/lib/lp/services/worlddata/model/language.py
1050+++ b/lib/lp/services/worlddata/model/language.py
1051@@ -26,7 +26,7 @@ from lp.registry.model.karma import (
1052 from lp.services.database.decoratedresultset import DecoratedResultSet
1053 from lp.services.database.enumcol import DBEnum
1054 from lp.services.database.interfaces import (
1055- ISlaveStore,
1056+ IStandbyStore,
1057 IStore,
1058 )
1059 from lp.services.database.sqlbase import SQLBase
1060@@ -292,7 +292,7 @@ class LanguageSet:
1061 """See `ILanguageSet`."""
1062 if text:
1063 text = six.ensure_text(text).lower()
1064- results = ISlaveStore(Language).find(
1065+ results = IStandbyStore(Language).find(
1066 Language, Or(
1067 Language.code.lower().contains_string(text),
1068 Language.englishname.lower().contains_string(
1069diff --git a/lib/lp/soyuz/model/archive.py b/lib/lp/soyuz/model/archive.py
1070index b3c7798..59312ea 100644
1071--- a/lib/lp/soyuz/model/archive.py
1072+++ b/lib/lp/soyuz/model/archive.py
1073@@ -105,7 +105,7 @@ from lp.services.database.datetimecol import UtcDateTimeCol
1074 from lp.services.database.decoratedresultset import DecoratedResultSet
1075 from lp.services.database.enumcol import DBEnum
1076 from lp.services.database.interfaces import (
1077- ISlaveStore,
1078+ IStandbyStore,
1079 IStore,
1080 )
1081 from lp.services.database.sqlbase import (
1082@@ -1097,7 +1097,7 @@ class Archive(SQLBase):
1083 Component.name.is_in(components))
1084 for (archive, not_used, pocket, components) in deps])
1085
1086- return ISlaveStore(BinaryPackagePublishingHistory).find(
1087+ return IStandbyStore(BinaryPackagePublishingHistory).find(
1088 BinaryPackagePublishingHistory,
1089 BinaryPackageName.name == dep_name,
1090 BinaryPackagePublishingHistory.binarypackagename ==
1091diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py
1092index 9e7be9a..cbc40ac 100644
1093--- a/lib/lp/soyuz/tests/test_archive.py
1094+++ b/lib/lp/soyuz/tests/test_archive.py
1095@@ -1901,7 +1901,7 @@ class TestFindDepCandidates(TestCaseWithFactory):
1096 archive, and compares it to the given expected value.
1097 The archive defaults to self.archive.
1098
1099- Also commits, since findDepCandidates uses the slave store.
1100+ Also commits, since findDepCandidates uses the standby store.
1101 """
1102 transaction.commit()
1103
1104diff --git a/lib/lp/testing/factory.py b/lib/lp/testing/factory.py
1105index 71265f7..1588aad 100644
1106--- a/lib/lp/testing/factory.py
1107+++ b/lib/lp/testing/factory.py
1108@@ -397,7 +397,7 @@ def default_master_store(func):
1109
1110 In some cases, such as in the middle of a page test story,
1111 we might be calling factory methods with the default Store set
1112- to the slave which breaks stuff. For instance, if we set an account's
1113+ to the standby which breaks stuff. For instance, if we set an account's
1114 password that needs to happen on the master store and this is forced.
1115 However, if we then read it back the default Store has to be used.
1116 """
1117diff --git a/lib/lp/translations/doc/poexport-request.txt b/lib/lp/translations/doc/poexport-request.txt
1118index ba2b666..18d685d 100644
1119--- a/lib/lp/translations/doc/poexport-request.txt
1120+++ b/lib/lp/translations/doc/poexport-request.txt
1121@@ -33,7 +33,7 @@ Our user requests the Catalan and Czech translations of a template.
1122
1123 Now we request that the queue be processed.
1124
1125-(Commits are needed to make the test requests seep through to the slave
1126+(Commits are needed to make the test requests seep through to the standby
1127 database).
1128
1129 >>> import transaction
1130diff --git a/lib/lp/translations/doc/poexportqueue-replication-lag.txt b/lib/lp/translations/doc/poexportqueue-replication-lag.txt
1131index 409fb71..e737cfc 100644
1132--- a/lib/lp/translations/doc/poexportqueue-replication-lag.txt
1133+++ b/lib/lp/translations/doc/poexportqueue-replication-lag.txt
1134@@ -2,7 +2,7 @@ Replication Lag and the Export Queue
1135 ====================================
1136
1137 Due to replication lag it's possible for the export queue to see a
1138-request on the slave store that it actually just removed from the master
1139+request on the standby store that it actually just removed from the master
1140 store.
1141
1142 We start our story with an empty export queue.
1143@@ -71,7 +71,7 @@ were to ask again.
1144 ja
1145
1146 The first request is removed from the master store after processing, but
1147-not yet from the slave store. (Since this test is all one session, we
1148+not yet from the standby store. (Since this test is all one session, we
1149 can reproduce this by not committing the removal). The second request
1150 is still technically on the queue, but no longer "live."
1151
1152diff --git a/lib/lp/translations/doc/potmsgset.txt b/lib/lp/translations/doc/potmsgset.txt
1153index a7a8d79..da86a39 100644
1154--- a/lib/lp/translations/doc/potmsgset.txt
1155+++ b/lib/lp/translations/doc/potmsgset.txt
1156@@ -4,7 +4,7 @@ POTMsgSet tests
1157 POTMsgSet represents messages to translate that a POTemplate file has.
1158
1159 In this test we'll be committing a lot to let changes replicate to the
1160-slave database.
1161+standby database.
1162
1163 >>> import transaction
1164
1165diff --git a/lib/lp/translations/interfaces/poexportrequest.py b/lib/lp/translations/interfaces/poexportrequest.py
1166index de4ad9b..2d0968b 100644
1167--- a/lib/lp/translations/interfaces/poexportrequest.py
1168+++ b/lib/lp/translations/interfaces/poexportrequest.py
1169@@ -47,7 +47,7 @@ class IPOExportRequestSet(Interface):
1170 * The requested `TranslationFileFormat`.
1171 * The list of request record ids making up this request.
1172
1173- The objects are all read-only objects from the slave store. The
1174+ The objects are all read-only objects from the standby store. The
1175 request ids list should be passed to `removeRequest` when
1176 processing of the request completes.
1177 """
1178diff --git a/lib/lp/translations/interfaces/potmsgset.py b/lib/lp/translations/interfaces/potmsgset.py
1179index 4af6b3d..3390f5f 100644
1180--- a/lib/lp/translations/interfaces/potmsgset.py
1181+++ b/lib/lp/translations/interfaces/potmsgset.py
1182@@ -172,7 +172,7 @@ class IPOTMsgSet(Interface):
1183 `POTMsgSet` that are actually used (i.e. current or imported) in
1184 other templates.
1185
1186- The suggestions are read-only; they come from the slave store.
1187+ The suggestions are read-only; they come from the standby store.
1188
1189 :param language: language we want translations for.
1190 """
1191@@ -184,7 +184,7 @@ class IPOTMsgSet(Interface):
1192 `POTMsgSet` that were entered in another context, but for the
1193 same English text, and are not in actual use.
1194
1195- The suggestions are read-only; they come from the slave store.
1196+ The suggestions are read-only; they come from the standby store.
1197
1198 :param language: language we want translations for.
1199 """
1200diff --git a/lib/lp/translations/model/poexportrequest.py b/lib/lp/translations/model/poexportrequest.py
1201index dc9b7d9..c532086 100644
1202--- a/lib/lp/translations/model/poexportrequest.py
1203+++ b/lib/lp/translations/model/poexportrequest.py
1204@@ -20,7 +20,7 @@ from lp.services.database.constants import DEFAULT
1205 from lp.services.database.enumcol import DBEnum
1206 from lp.services.database.interfaces import (
1207 IMasterStore,
1208- ISlaveStore,
1209+ IStandbyStore,
1210 IStore,
1211 )
1212 from lp.services.database.sqlbase import quote
1213@@ -121,7 +121,7 @@ class POExportRequestSet:
1214 """Return the oldest live request on the master store.
1215
1216 Due to replication lag, the master store is always a little
1217- ahead of the slave store that exports come from.
1218+ ahead of the standby store that exports come from.
1219 """
1220 master_store = IMasterStore(POExportRequest)
1221 sorted_by_id = master_store.find(POExportRequest).order_by(
1222@@ -130,7 +130,7 @@ class POExportRequestSet:
1223
1224 def _getHeadRequest(self):
1225 """Return oldest request on the queue."""
1226- # Due to replication lag, it's possible that the slave store
1227+ # Due to replication lag, it's possible that the standby store
1228 # still has copies of requests that have already been completed
1229 # and deleted from the master store. So first get the oldest
1230 # request that is "live," i.e. still present on the master
1231@@ -139,21 +139,21 @@ class POExportRequestSet:
1232 if oldest_live is None:
1233 return None
1234 else:
1235- return ISlaveStore(POExportRequest).find(
1236+ return IStandbyStore(POExportRequest).find(
1237 POExportRequest,
1238 POExportRequest.id == oldest_live.id).one()
1239
1240 def getRequest(self):
1241 """See `IPOExportRequestSet`."""
1242- # Exports happen off the slave store. To ensure that export
1243+ # Exports happen off the standby store. To ensure that export
1244 # does not happen until requests have been replicated to the
1245- # slave, they are read primarily from the slave even though they
1246+ # standby, they are read primarily from the standby even though they
1247 # are deleted on the master afterwards.
1248 head = self._getHeadRequest()
1249 if head is None:
1250 return None, None, None, None
1251
1252- requests = ISlaveStore(POExportRequest).find(
1253+ requests = IStandbyStore(POExportRequest).find(
1254 POExportRequest,
1255 POExportRequest.person == head.person,
1256 POExportRequest.format == head.format,
1257diff --git a/lib/lp/translations/model/potmsgset.py b/lib/lp/translations/model/potmsgset.py
1258index 9435564..49c4051 100644
1259--- a/lib/lp/translations/model/potmsgset.py
1260+++ b/lib/lp/translations/model/potmsgset.py
1261@@ -374,7 +374,7 @@ class POTMsgSet(SQLBase):
1262 A message is used if it's either imported or current, and unused
1263 otherwise.
1264
1265- Suggestions are read-only, so these objects come from the slave
1266+ Suggestions are read-only, so these objects come from the standby
1267 store.
1268
1269 :param suggested_languages: Languages that suggestions should be found
1270diff --git a/lib/lp/translations/model/translationgroup.py b/lib/lp/translations/model/translationgroup.py
1271index ab39ddf..c274697 100644
1272--- a/lib/lp/translations/model/translationgroup.py
1273+++ b/lib/lp/translations/model/translationgroup.py
1274@@ -25,7 +25,7 @@ from lp.services.database.constants import DEFAULT
1275 from lp.services.database.datetimecol import UtcDateTimeCol
1276 from lp.services.database.decoratedresultset import DecoratedResultSet
1277 from lp.services.database.interfaces import (
1278- ISlaveStore,
1279+ IStandbyStore,
1280 IStore,
1281 )
1282 from lp.services.database.sqlbase import SQLBase
1283@@ -219,7 +219,7 @@ class TranslationGroup(SQLBase):
1284 LibraryFileAlias,
1285 LibraryFileContent,
1286 )
1287- project_data = ISlaveStore(ProjectGroup).using(*using).find(
1288+ project_data = IStandbyStore(ProjectGroup).using(*using).find(
1289 tables,
1290 ProjectGroup.translationgroupID == self.id,
1291 ProjectGroup.active == True).order_by(ProjectGroup.display_name)
1292@@ -244,7 +244,7 @@ class TranslationGroup(SQLBase):
1293 LibraryFileAlias,
1294 LibraryFileContent,
1295 )
1296- distro_data = ISlaveStore(Distribution).using(*using).find(
1297+ distro_data = IStandbyStore(Distribution).using(*using).find(
1298 tables, Distribution.translationgroupID == self.id).order_by(
1299 Distribution.display_name)
1300
1301diff --git a/lib/lp/translations/model/translationimportqueue.py b/lib/lp/translations/model/translationimportqueue.py
1302index 39df58b..03f85e7 100644
1303--- a/lib/lp/translations/model/translationimportqueue.py
1304+++ b/lib/lp/translations/model/translationimportqueue.py
1305@@ -60,7 +60,7 @@ from lp.services.database.constants import (
1306 from lp.services.database.enumcol import DBEnum
1307 from lp.services.database.interfaces import (
1308 IMasterStore,
1309- ISlaveStore,
1310+ IStandbyStore,
1311 IStore,
1312 )
1313 from lp.services.database.sqlbase import quote
1314@@ -1388,13 +1388,13 @@ class TranslationImportQueue:
1315
1316 return approved_entries
1317
1318- def _getSlaveStore(self):
1319- """Return the slave store for the import queue.
1320+ def _getStandbyStore(self):
1321+ """Return the standby store for the import queue.
1322
1323 Tests can override this to avoid unnecessary synchronization
1324 issues.
1325 """
1326- return ISlaveStore(TranslationImportQueueEntry)
1327+ return IStandbyStore(TranslationImportQueueEntry)
1328
1329 def _getBlockableDirectories(self):
1330 """Describe all directories where uploads are to be blocked.
1331@@ -1415,7 +1415,7 @@ class TranslationImportQueue:
1332 """
1333 importer = getUtility(ITranslationImporter)
1334
1335- store = self._getSlaveStore()
1336+ store = self._getStandbyStore()
1337 TIQE = TranslationImportQueueEntry
1338 result = store.find(
1339 (TIQE.distroseries_id, TIQE.sourcepackagename_id,
1340diff --git a/lib/lp/translations/model/vpoexport.py b/lib/lp/translations/model/vpoexport.py
1341index 4e1f730..11b7c1a 100644
1342--- a/lib/lp/translations/model/vpoexport.py
1343+++ b/lib/lp/translations/model/vpoexport.py
1344@@ -70,7 +70,7 @@ class VPOExportSet:
1345 if languagepack:
1346 conditions.append(POTemplate.languagepack == True)
1347
1348- # Use the slave store. We may want to write to the distroseries
1349+ # Use the standby store. We may want to write to the distroseries
1350 # to register a language pack, but not to the translation data
1351 # we retrieve for it.
1352 # XXX wgrant 2017-03-21: Moved to master to avoid termination
1353diff --git a/lib/lp/translations/scripts/tests/test_translations_to_branch.py b/lib/lp/translations/scripts/tests/test_translations_to_branch.py
1354index ae6c1c2..e99e417 100644
1355--- a/lib/lp/translations/scripts/tests/test_translations_to_branch.py
1356+++ b/lib/lp/translations/scripts/tests/test_translations_to_branch.py
1357@@ -22,7 +22,7 @@ from lp.registry.interfaces.teammembership import (
1358 )
1359 from lp.registry.model.productseries import ProductSeries
1360 from lp.services.config import config
1361-from lp.services.database.interfaces import ISlaveStore
1362+from lp.services.database.interfaces import IStandbyStore
1363 from lp.services.log.logger import BufferLogger
1364 from lp.services.scripts.tests import run_script
1365 from lp.testing import (
1366@@ -162,11 +162,11 @@ class TestExportTranslationsToBranch(TestCaseWithFactory):
1367 self.assertNotEqual(
1368 db_branch.last_mirrored_id,
1369 six.ensure_text(tree.branch.last_revision()))
1370- # The export code works on a Branch from the slave store. It
1371+ # The export code works on a Branch from the standby store. It
1372 # shouldn't stop the scan request.
1373- slave_series = ISlaveStore(productseries).get(
1374+ standby_series = IStandbyStore(productseries).get(
1375 ProductSeries, productseries.id)
1376- exporter._exportToBranch(slave_series)
1377+ exporter._exportToBranch(standby_series)
1378 self.assertEqual(
1379 db_branch.last_mirrored_id,
1380 six.ensure_text(tree.branch.last_revision()))
1381diff --git a/lib/lp/translations/scripts/translations_to_branch.py b/lib/lp/translations/scripts/translations_to_branch.py
1382index 92f5ca4..c3ef20b 100644
1383--- a/lib/lp/translations/scripts/translations_to_branch.py
1384+++ b/lib/lp/translations/scripts/translations_to_branch.py
1385@@ -39,7 +39,7 @@ from lp.codehosting.vfs import get_rw_server
1386 from lp.services.config import config
1387 from lp.services.database.interfaces import (
1388 IMasterStore,
1389- ISlaveStore,
1390+ IStandbyStore,
1391 )
1392 from lp.services.helpers import shortlist
1393 from lp.services.mail.helpers import (
1394@@ -312,7 +312,7 @@ class ExportTranslationsToBranch(LaunchpadCronScript):
1395
1396 self.logger.info("Exporting to translations branches.")
1397
1398- self.store = ISlaveStore(Product)
1399+ self.store = IStandbyStore(Product)
1400
1401 product_join = Join(
1402 ProductSeries, Product, ProductSeries.product == Product.id)
1403diff --git a/lib/lp/translations/tests/test_autoapproval.py b/lib/lp/translations/tests/test_autoapproval.py
1404index b778fac..b567c9d 100644
1405--- a/lib/lp/translations/tests/test_autoapproval.py
1406+++ b/lib/lp/translations/tests/test_autoapproval.py
1407@@ -1154,9 +1154,9 @@ class TestAutoBlocking(TestCaseWithFactory):
1408 super().setUp()
1409 self.queue = TranslationImportQueue()
1410 # Our test queue operates on the master store instead of the
1411- # slave store so we don't have to synchronize stores.
1412+ # standby store so we don't have to synchronize stores.
1413 master_store = IMasterStore(TranslationImportQueueEntry)
1414- self.queue._getSlaveStore = FakeMethod(result=master_store)
1415+ self.queue._getStandbyStore = FakeMethod(result=master_store)
1416
1417 def _copyTargetFromEntry(self, entry):
1418 """Return a dict representing `entry`'s translation target.
1419diff --git a/lib/lp/translations/tests/test_translationimportqueue.py b/lib/lp/translations/tests/test_translationimportqueue.py
1420index 671195a..06abfdb 100644
1421--- a/lib/lp/translations/tests/test_translationimportqueue.py
1422+++ b/lib/lp/translations/tests/test_translationimportqueue.py
1423@@ -12,7 +12,7 @@ from zope.security.proxy import removeSecurityProxy
1424 from lp.app.enums import InformationType
1425 from lp.app.interfaces.launchpad import ILaunchpadCelebrities
1426 from lp.services.database.interfaces import (
1427- ISlaveStore,
1428+ IStandbyStore,
1429 IStore,
1430 )
1431 from lp.services.librarianserver.testing.fake import FakeLibrarian
1432@@ -484,14 +484,14 @@ class TestTranslationImportQueue(TestCaseWithFactory):
1433 # reshuffled to see if reportApprovalConflict can be fooled into
1434 # thinking it's a different error. Make as sure as we can that
1435 # entry.error_output is not modified.
1436- slave_entry = ISlaveStore(entry).get(
1437+ standby_entry = IStandbyStore(entry).get(
1438 TranslationImportQueueEntry, entry.id)
1439- slave_entry.setErrorOutput = FakeMethod()
1440- slave_entry.reportApprovalConflict(
1441+ standby_entry.setErrorOutput = FakeMethod()
1442+ standby_entry.reportApprovalConflict(
1443 domain, len(templates), reversed(templates))
1444- self.assertEqual(original_error, slave_entry.error_output)
1445+ self.assertEqual(original_error, standby_entry.error_output)
1446 self.assertIn(domain, original_error)
1447- self.assertEqual(0, slave_entry.setErrorOutput.call_count)
1448+ self.assertEqual(0, standby_entry.setErrorOutput.call_count)
1449
1450
1451 class TestHelpers(TestCaseWithFactory):
1452diff --git a/scripts/get-stacked-on-branches.py b/scripts/get-stacked-on-branches.py
1453index 9a60b7f..6c15bc0 100755
1454--- a/scripts/get-stacked-on-branches.py
1455+++ b/scripts/get-stacked-on-branches.py
1456@@ -27,7 +27,7 @@ from optparse import OptionParser
1457
1458 from storm.locals import Not
1459
1460-from lp.services.database.interfaces import ISlaveStore
1461+from lp.services.database.interfaces import IStandbyStore
1462 from lp.services.scripts import execute_zcml_for_scripts
1463
1464
1465@@ -35,7 +35,7 @@ def get_stacked_branches():
1466 """Iterate over all branches that, according to the db, are stacked."""
1467 # Avoiding circular import.
1468 from lp.code.model.branch import Branch
1469- return ISlaveStore(Branch).find(Branch, Not(Branch.stacked_on == None))
1470+ return IStandbyStore(Branch).find(Branch, Not(Branch.stacked_on == None))
1471
1472
1473 def main():
1474diff --git a/utilities/soyuz-sampledata-setup.py b/utilities/soyuz-sampledata-setup.py
1475index b8cb28e..cde53e9 100755
1476--- a/utilities/soyuz-sampledata-setup.py
1477+++ b/utilities/soyuz-sampledata-setup.py
1478@@ -40,7 +40,7 @@ from lp.registry.interfaces.series import SeriesStatus
1479 from lp.registry.model.codeofconduct import SignedCodeOfConduct
1480 from lp.services.database.interfaces import (
1481 IMasterStore,
1482- ISlaveStore,
1483+ IStandbyStore,
1484 )
1485 from lp.services.scripts.base import LaunchpadScript
1486 from lp.soyuz.enums import SourcePackageFormat
1487@@ -78,7 +78,7 @@ def check_preconditions(options):
1488 This script must not run on a production server, or anything
1489 remotely like it.
1490 """
1491- store = ISlaveStore(ComponentSelection)
1492+ store = IStandbyStore(ComponentSelection)
1493
1494 # Just a guess, but dev systems aren't likely to have ids this high
1495 # in this table. Production data does.

Subscribers

People subscribed via source and target branches

to status/vote changes: