This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add new columns tracking when we partial-joined #13892
Merged
DMRobertson
merged 8 commits into
develop
from
dmr/faster-joins/outbound-device-list-tracking
Sep 27, 2022
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e986a7f
Add new columns tracking when we partial-joined
de0002b
Store when we partial-joined
270da67
Changelog
b5d67c4
Drop the foreign key constraint :(
0f419d1
stream id column: NOT NULL DEFAULT 0
94ee1e2
Add back the foreign key constraint
be843f7
Fix a bug where dmr 30.3.1 would type w/o thinking
7118e1d
Merge branch 'develop' into dmr/faster-joins/outbound-device-list-tra…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Faster remote room joins: record _when_ we first partial-join to a room. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
synapse/storage/schema/main/delta/73/04partial_join_details.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,23 @@ | ||||||
/* Copyright 2022 The Matrix.org Foundation C.I.C | ||||||
* | ||||||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
* you may not use this file except in compliance with the License. | ||||||
* You may obtain a copy of the License at | ||||||
* | ||||||
* http://www.apache.org/licenses/LICENSE-2.0 | ||||||
* | ||||||
* Unless required by applicable law or agreed to in writing, software | ||||||
* distributed under the License is distributed on an "AS IS" BASIS, | ||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
* See the License for the specific language governing permissions and | ||||||
* limitations under the License. | ||||||
*/ | ||||||
|
||||||
-- To ensure we correctly notify other homeservers about device list changes from our | ||||||
-- users after a partial join transitions to a full join, we need to know when we began | ||||||
-- the partial join. For now it's sufficient to know the device_list stream_id at the | ||||||
-- time of the partial join, and the join event created for us during a partial join. | ||||||
-- | ||||||
-- Both columns are nullable without defaults, for backwards compatibility. | ||||||
ALTER TABLE partial_state_rooms ADD COLUMN device_lists_stream_id BIGINT; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the appropriate value to use for a default? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OH, because there might be existing entries. Hmm. I think 0 should be fine. It means we'll resend out all device list updates, but nothing should actually be using partial joins yet |
||||||
ALTER TABLE partial_state_rooms ADD COLUMN join_event_id TEXT; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we insert null here, and then update it with the join event ID in the persist event DB transaction? That way we might be able to keep the foreign key constraint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd mean that we have to tell the persist event logic "you're persisting a partial join response" somehow. I can look at doing this but I'm not sure if it's worth the extra complexity in the persistence path. WDYT?