Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add schema comments about the destinations and destination_rooms tables. #15247

Merged
merged 3 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15247.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add schema comments about the `destinations` and `destination_rooms` tables.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* Copyright 2023 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.
*/


--- destinations
COMMENT ON TABLE destinations IS
'Information about remote homeservers and the health of our connection to them.';

COMMENT ON COLUMN destinations.destination IS 'server name of remote homeserver in question';

COMMENT ON COLUMN destinations.last_successful_stream_ordering IS
'Stream ordering of the most recently successfully sent PDU to this server. See `destination_rooms` for more information about catch-up.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most recently successfully sent PDU

Is this among PDUs created by ourselves only? We can send other servers' PDUs during catchup, or if someone requests backfill, I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just by the transmission loop or the catch-up transmission loop (but we only mark our own PDUs, even if we send a later forward extremity to represent it).
Updating comment.


COMMENT ON COLUMN destinations.retry_last_ts IS
'The last time we tried and failed to reach the remote server, in ms.';

COMMENT ON COLUMN destinations.retry_interval IS
'How long since the last time we tried to reach the remote server before trying again, in ms.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this? I'd've guessed this is how long to wait after retry_last_ts to attempt retransmission.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have copied the docstring from another struct where the context is a bit different, but you're right — tweaked


COMMENT ON COLUMN destinations.failure_ts IS
'The first time we tried and failed to reach the remote server, in ms.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we successfully retry transmission does this get reset to 0 or NULL? Ditto for the other two cols above.




--- destination_rooms
COMMENT ON TABLE destination_rooms IS
'Information about transmission of PDUs in a given room to a given remote homeserver.';

COMMENT ON COLUMN destination_rooms.destination IS 'server name of remote homeserver in question';

COMMENT ON COLUMN destination_rooms.room_id IS 'room ID in question';

COMMENT ON COLUMN destination_rooms.stream_ordering IS
'most recent PDU in this room that needs to be sent to this homeserver';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, most recent PDU created by ourselves rather than other HSes?