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

Commit

Permalink
Merge branch 'develop' into shay/batch_persist
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Sep 8, 2022
2 parents bcff512 + 5261d2e commit 8f4488c
Show file tree
Hide file tree
Showing 76 changed files with 974 additions and 211 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/latest_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# As an overview this workflow:
# - checks out develop,
# - installs from source, pulling in the dependencies like a fresh `pip install` would, and
# - installs from source, pulling in the dependencies like a fresh `pip install` would, and
# - runs mypy and test suites in that checkout.
#
# Based on the twisted trunk CI job.
Expand All @@ -26,12 +26,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2

# The dev dependencies aren't exposed in the wheel metadata (at least with current
# poetry-core versions), so we install with poetry.
- uses: matrix-org/setup-python-poetry@v1
with:
python-version: "3.x"
poetry-version: "1.2.0b1"
poetry-version: "1.2.0"
extras: "all"
# Dump installed versions for debugging.
- run: poetry run pip list > before.txt
Expand All @@ -53,6 +60,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2

- run: sudo apt-get -qq install xmlsec1
- name: Set up PostgreSQL ${{ matrix.postgres-version }}
if: ${{ matrix.postgres-version }}
Expand All @@ -69,6 +84,12 @@ jobs:
if: ${{ matrix.postgres-version }}
timeout-minutes: 2
run: until pg_isready -h localhost; do sleep 1; done

# We nuke the local copy, as we've installed synapse into the virtualenv
# (rather than use an editable install, which we no longer support). If we
# don't do this then python can't find the native lib.
- run: rm -rf synapse/

- run: python -m twisted.trial --jobs=2 tests
env:
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
Expand Down Expand Up @@ -113,6 +134,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2

- name: Ensure sytest runs `pip install`
# Delete the lockfile so sytest will `pip install` rather than `poetry install`
run: rm /src/poetry.lock
Expand Down Expand Up @@ -187,4 +216,3 @@ jobs:
with:
update_existing: true
filename: .ci/latest_deps_build_failed_issue_template.md

5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
with:
toolchain: 1.61.0
override: true
- uses: Swatinem/rust-cache@v2

# There aren't wheels for some of the older deps, so we need to install
# their build dependencies
Expand Down Expand Up @@ -253,11 +254,14 @@ jobs:
- uses: actions/checkout@v2
- name: Prepare test blacklist
run: cat sytest-blacklist .ci/worker-blacklist > synapse-blacklist-with-workers

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.61.0
override: true
- uses: Swatinem/rust-cache@v2

- name: Run SyTest
run: /bootstrap.sh synapse
working-directory: /src
Expand Down Expand Up @@ -369,6 +373,7 @@ jobs:
with:
toolchain: 1.61.0
override: true
- uses: Swatinem/rust-cache@v2

- name: Prepare Complement's Prerequisites
run: synapse/.ci/scripts/setup_complement_prerequisites.sh
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/twisted_trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2

- uses: matrix-org/setup-python-poetry@v1
with:
python-version: "3.x"
Expand All @@ -34,6 +42,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: sudo apt-get -qq install xmlsec1

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2

- uses: matrix-org/setup-python-poetry@v1
with:
python-version: "3.x"
Expand Down Expand Up @@ -66,6 +82,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2

- name: Patch dependencies
# Note: The poetry commands want to create a virtualenv in /src/.venv/,
# but the sytest-synapse container expects it to be in /venv/.
Expand Down
1 change: 1 addition & 0 deletions changelog.d/13506.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in Synapse v1.41.0 where the `/hierarchy` API returned non-standard information (a `room_id` field under each entry in `children_state`).
1 change: 1 addition & 0 deletions changelog.d/13672.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add admin APIs to fetch messages within a particular window of time.
1 change: 1 addition & 0 deletions changelog.d/13680.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cancel the processing of key query requests when they time out.
1 change: 1 addition & 0 deletions changelog.d/13687.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve validation of request bodies for the following client-server API endpoints: [`/account/3pid/msisdn/requestToken`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3account3pidmsisdnrequesttoken) and [`/org.matrix.msc3720/account_status`](https://github.com/matrix-org/matrix-spec-proposals/blob/babolivier/user_status/proposals/3720-account-status.md#post-_matrixclientv1account_status).
1 change: 1 addition & 0 deletions changelog.d/13706.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename the `EventFormatVersions` enum values so that they line up with room version numbers.
1 change: 1 addition & 0 deletions changelog.d/13717.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add experimental configuration option to allow disabling legacy Prometheus metric names.
1 change: 1 addition & 0 deletions changelog.d/13718.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add experimental configuration option to allow disabling legacy Prometheus metric names.
1 change: 1 addition & 0 deletions changelog.d/13726.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a mistake in the config manual: the `event_cache_size` _is_ scaled by `caches.global_factor`. The documentation was incorrect since Synapse 1.22.
1 change: 1 addition & 0 deletions changelog.d/13728.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Define Synapse's compatability policy for SQLite versions.
1 change: 1 addition & 0 deletions changelog.d/13730.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Instrument `get_metadata_for_events` for understandable traces in Jaeger.
1 change: 1 addition & 0 deletions changelog.d/13734.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a stub Rust crate.
1 change: 1 addition & 0 deletions changelog.d/13735.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a stub Rust crate.
1 change: 1 addition & 0 deletions changelog.d/13738.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug where Synapse fails to start if a signing key file contains an empty line.
1 change: 1 addition & 0 deletions changelog.d/13741.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document the timestamp when a user accepts the consent, if [consent tracking](https://matrix-org.github.io/synapse/latest/consent_tracking.html) is used.
1 change: 1 addition & 0 deletions changelog.d/13743.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a stub Rust crate.
1 change: 1 addition & 0 deletions changelog.d/13746.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a long standing bug where Synapse would fail to handle malformed user IDs or room aliases gracefully in certain cases.
1 change: 1 addition & 0 deletions changelog.d/13748.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid raising an error due to malformed user IDs in `get_current_hosts_in_room`. Malformed user IDs cannot currently join a room, so this error would not be hit.
1 change: 1 addition & 0 deletions changelog.d/13750.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the docstrings for `get_users_in_room` and `get_current_hosts_in_room` to explain the impact of partial state.
1 change: 1 addition & 0 deletions changelog.d/13756.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused Prometheus recording rules from `synapse-v2.rules` and add comments describing where the rest are used.
21 changes: 0 additions & 21 deletions contrib/prometheus/synapse-v1.rules

This file was deleted.

49 changes: 17 additions & 32 deletions contrib/prometheus/synapse-v2.rules
Original file line number Diff line number Diff line change
@@ -1,55 +1,35 @@
groups:
- name: synapse
rules:
- record: "synapse_federation_transaction_queue_pendingEdus:total"
expr: "sum(synapse_federation_transaction_queue_pendingEdus or absent(synapse_federation_transaction_queue_pendingEdus)*0)"
- record: "synapse_federation_transaction_queue_pendingPdus:total"
expr: "sum(synapse_federation_transaction_queue_pendingPdus or absent(synapse_federation_transaction_queue_pendingPdus)*0)"
- record: 'synapse_http_server_request_count:method'
labels:
servlet: ""
expr: "sum(synapse_http_server_request_count) by (method)"
- record: 'synapse_http_server_request_count:servlet'
labels:
method: ""
expr: 'sum(synapse_http_server_request_count) by (servlet)'

- record: 'synapse_http_server_request_count:total'
labels:
servlet: ""
expr: 'sum(synapse_http_server_request_count:by_method) by (servlet)'

- record: 'synapse_cache:hit_ratio_5m'
expr: 'rate(synapse_util_caches_cache:hits[5m]) / rate(synapse_util_caches_cache:total[5m])'
- record: 'synapse_cache:hit_ratio_30s'
expr: 'rate(synapse_util_caches_cache:hits[30s]) / rate(synapse_util_caches_cache:total[30s])'

# These 3 rules are used in the included Prometheus console
- record: 'synapse_federation_client_sent'
labels:
type: "EDU"
expr: 'synapse_federation_client_sent_edus + 0'
expr: 'synapse_federation_client_sent_edus_total + 0'
- record: 'synapse_federation_client_sent'
labels:
type: "PDU"
expr: 'synapse_federation_client_sent_pdu_destinations:count + 0'
expr: 'synapse_federation_client_sent_pdu_destinations_count_total + 0'
- record: 'synapse_federation_client_sent'
labels:
type: "Query"
expr: 'sum(synapse_federation_client_sent_queries) by (job)'

# These 3 rules are used in the included Prometheus console
- record: 'synapse_federation_server_received'
labels:
type: "EDU"
expr: 'synapse_federation_server_received_edus + 0'
expr: 'synapse_federation_server_received_edus_total + 0'
- record: 'synapse_federation_server_received'
labels:
type: "PDU"
expr: 'synapse_federation_server_received_pdus + 0'
expr: 'synapse_federation_server_received_pdus_total + 0'
- record: 'synapse_federation_server_received'
labels:
type: "Query"
expr: 'sum(synapse_federation_server_received_queries) by (job)'

# These 2 rules are used in the included Prometheus console
- record: 'synapse_federation_transaction_queue_pending'
labels:
type: "EDU"
Expand All @@ -59,20 +39,25 @@ groups:
type: "PDU"
expr: 'synapse_federation_transaction_queue_pending_pdus + 0'

# These 3 rules are used in the included Grafana dashboard
- record: synapse_storage_events_persisted_by_source_type
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_type="remote"})
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep_total{origin_type="remote"})
labels:
type: remote
- record: synapse_storage_events_persisted_by_source_type
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_entity="*client*",origin_type="local"})
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep_total{origin_entity="*client*",origin_type="local"})
labels:
type: local
- record: synapse_storage_events_persisted_by_source_type
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_entity!="*client*",origin_type="local"})
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep_total{origin_entity!="*client*",origin_type="local"})
labels:
type: bridges

# This rule is used in the included Grafana dashboard
- record: synapse_storage_events_persisted_by_event_type
expr: sum without(origin_entity, origin_type) (synapse_storage_events_persisted_events_sep)
expr: sum without(origin_entity, origin_type) (synapse_storage_events_persisted_events_sep_total)

# This rule is used in the included Grafana dashboard
- record: synapse_storage_events_persisted_by_origin
expr: sum without(type) (synapse_storage_events_persisted_events_sep)
expr: sum without(type) (synapse_storage_events_persisted_events_sep_total)

Loading

0 comments on commit 8f4488c

Please sign in to comment.