Move away from backfill language

This commit is contained in:
Eric Eastwood
2024-08-22 16:48:02 -05:00
parent 4d87fa61c6
commit 693c06b2f1
2 changed files with 14 additions and 14 deletions
@@ -294,7 +294,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
where_clause="NOT outlier",
)
# Backfill the sliding sync tables
# Add some background updates to populate the sliding sync tables
self.db_pool.updates.register_background_update_handler(
_BackgroundUpdates.SLIDING_SYNC_JOINED_ROOMS_BG_UPDATE,
self._sliding_sync_joined_rooms_bg_update,
@@ -1546,7 +1546,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
self, progress: JsonDict, batch_size: int
) -> int:
"""
Handles backfilling the `sliding_sync_joined_rooms` table.
Background update to populate the `sliding_sync_joined_rooms` table.
"""
last_room_id = progress.get("last_room_id", "")
@@ -1631,7 +1631,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
last_current_state_delta_stream_id,
)
def _backfill_table_txn(txn: LoggingTransaction) -> None:
def _fill_table_txn(txn: LoggingTransaction) -> None:
# Handle updating the `sliding_sync_joined_rooms` table
#
last_successful_room_id: Optional[str] = None
@@ -1710,7 +1710,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
last_successful_room_id = room_id
await self.db_pool.runInteraction(
"sliding_sync_joined_rooms_bg_update", _backfill_table_txn
"sliding_sync_joined_rooms_bg_update", _fill_table_txn
)
# Update the progress
@@ -1725,7 +1725,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
self, progress: JsonDict, batch_size: int
) -> int:
"""
Handles backfilling the `sliding_sync_membership_snapshots` table.
Background update to populate the `sliding_sync_membership_snapshots` table.
"""
last_event_stream_ordering = progress.get(
"last_event_stream_ordering", -(1 << 31)
@@ -1967,7 +1967,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
membership_event_stream_ordering=membership_event_stream_ordering,
)
def _backfill_table_txn(txn: LoggingTransaction) -> None:
def _fill_table_txn(txn: LoggingTransaction) -> None:
# Handle updating the `sliding_sync_membership_snapshots` table
#
for key, insert_map in to_insert_membership_snapshots.items():
@@ -2019,7 +2019,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
)
await self.db_pool.runInteraction(
"sliding_sync_membership_snapshots_bg_update", _backfill_table_txn
"sliding_sync_membership_snapshots_bg_update", _fill_table_txn
)
# Update the progress
+7 -7
View File
@@ -2860,7 +2860,7 @@ class SlidingSyncPrePopulatedTablesTestCase(HomeserverTestCase):
def test_joined_background_update_missing(self) -> None:
"""
Test that the background update for `sliding_sync_joined_rooms` backfills missing rows
Test that the background update for `sliding_sync_joined_rooms` populates missing rows
"""
user1_id = self.register_user("user1", "pass")
user1_tok = self.login(user1_id, "pass")
@@ -3004,7 +3004,7 @@ class SlidingSyncPrePopulatedTablesTestCase(HomeserverTestCase):
def test_joined_background_update_partial(self) -> None:
"""
Test that the background update for `sliding_sync_joined_rooms` backfills
Test that the background update for `sliding_sync_joined_rooms` populates
partially updated rows.
"""
user1_id = self.register_user("user1", "pass")
@@ -3109,7 +3109,7 @@ class SlidingSyncPrePopulatedTablesTestCase(HomeserverTestCase):
def test_membership_snapshots_background_update_joined(self) -> None:
"""
Test that the background update for `sliding_sync_membership_snapshots`
backfills missing rows for join memberships.
populates missing rows for join memberships.
"""
user1_id = self.register_user("user1", "pass")
user1_tok = self.login(user1_id, "pass")
@@ -3274,7 +3274,7 @@ class SlidingSyncPrePopulatedTablesTestCase(HomeserverTestCase):
def test_membership_snapshots_background_update_local_invite(self) -> None:
"""
Test that the background update for `sliding_sync_membership_snapshots`
backfills missing rows for invite memberships.
populates missing rows for invite memberships.
"""
user1_id = self.register_user("user1", "pass")
_user1_tok = self.login(user1_id, "pass")
@@ -3479,7 +3479,7 @@ class SlidingSyncPrePopulatedTablesTestCase(HomeserverTestCase):
) -> None:
"""
Test that the background update for `sliding_sync_membership_snapshots`
backfills missing rows for remote invites (out-of-band memberships).
populates missing rows for remote invites (out-of-band memberships).
"""
user1_id = self.register_user("user1", "pass")
_user1_tok = self.login(user1_id, "pass")
@@ -3696,7 +3696,7 @@ class SlidingSyncPrePopulatedTablesTestCase(HomeserverTestCase):
) -> None:
"""
Test that the background update for `sliding_sync_membership_snapshots`
backfills missing rows for remote invite rejections/retractions (out-of-band memberships).
populates missing rows for remote invite rejections/retractions (out-of-band memberships).
"""
user1_id = self.register_user("user1", "pass")
user1_tok = self.login(user1_id, "pass")
@@ -3947,7 +3947,7 @@ class SlidingSyncPrePopulatedTablesTestCase(HomeserverTestCase):
) -> None:
"""
Test that the background update for `sliding_sync_membership_snapshots`
backfills missing rows for leave memberships.
populates missing rows for leave memberships.
"""
user1_id = self.register_user("user1", "pass")
user1_tok = self.login(user1_id, "pass")