From 693c06b2f15f7388e12016e827b156f699ea4966 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Thu, 22 Aug 2024 16:48:02 -0500 Subject: [PATCH] Move away from backfill language --- .../storage/databases/main/events_bg_updates.py | 14 +++++++------- tests/storage/test_events.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/synapse/storage/databases/main/events_bg_updates.py b/synapse/storage/databases/main/events_bg_updates.py index c4938f6fc3..ac3a000f88 100644 --- a/synapse/storage/databases/main/events_bg_updates.py +++ b/synapse/storage/databases/main/events_bg_updates.py @@ -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 diff --git a/tests/storage/test_events.py b/tests/storage/test_events.py index bd6c625441..25710304a2 100644 --- a/tests/storage/test_events.py +++ b/tests/storage/test_events.py @@ -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")