mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-12 09:58:24 +00:00
Add the rust_sliding_sync option and a Rust SlidingSyncHandler
Phase 0 of the sliding sync port (renders/sliding-sync-rust-plan.md). No behaviour change: nothing calls the Rust handler yet. - `experimental_features.rust_sliding_sync: off | on`. There is no shadow mode. Booleans are accepted, as for `rust_sync`. - `synapse_rust.sliding_sync.SlidingSyncHandler`, built by `RustHandlers` on the native driver only. It shares the v2 sync handler's `SyncStore` and carries the pool, deferred and blocking helpers the later phases' entry points use. - `SlidingSyncStats`, observed per request into the `synapse_sliding_sync_rust_*` histograms. `SyncDbStats` now counts the transactions a reader begins. - The `synapse_sliding_sync_rust_rooms_total` and `synapse_sliding_sync_rust_requests_total` counters. - `SYNAPSE_TEST_RUST_SLIDING_SYNC` and `_STRICT` for trial, with the handler wrapped in `_BlockingRustCalls`, and `RUST_SLIDING_SYNC` for Complement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R5b7Ruy4cgt27Mjq6Ptxbb
This commit is contained in:
1 parent
a78b02b55c
commit
d63740fc30
15 files changed
+554
-24
No files matched your search
@@ -6,7 +6,7 @@ set -e
|
||||
|
||||
echo "Complement Synapse launcher"
|
||||
echo " Args: $*"
|
||||
echo " Env: SYNAPSE_COMPLEMENT_DATABASE=$SYNAPSE_COMPLEMENT_DATABASE SYNAPSE_COMPLEMENT_USE_WORKERS=$SYNAPSE_COMPLEMENT_USE_WORKERS SYNAPSE_COMPLEMENT_USE_ASYNCIO_REACTOR=$SYNAPSE_COMPLEMENT_USE_ASYNCIO_REACTOR SYNAPSE_USE_RUST_DRIVER=$SYNAPSE_USE_RUST_DRIVER SYNAPSE_RUST_STATE_RES=$SYNAPSE_RUST_STATE_RES SYNAPSE_RUST_SYNC=$SYNAPSE_RUST_SYNC"
|
||||
echo " Env: SYNAPSE_COMPLEMENT_DATABASE=$SYNAPSE_COMPLEMENT_DATABASE SYNAPSE_COMPLEMENT_USE_WORKERS=$SYNAPSE_COMPLEMENT_USE_WORKERS SYNAPSE_COMPLEMENT_USE_ASYNCIO_REACTOR=$SYNAPSE_COMPLEMENT_USE_ASYNCIO_REACTOR SYNAPSE_USE_RUST_DRIVER=$SYNAPSE_USE_RUST_DRIVER SYNAPSE_RUST_STATE_RES=$SYNAPSE_RUST_STATE_RES SYNAPSE_RUST_SYNC=$SYNAPSE_RUST_SYNC SYNAPSE_RUST_SLIDING_SYNC=$SYNAPSE_RUST_SLIDING_SYNC"
|
||||
|
||||
function log {
|
||||
d=$(printf '%(%Y-%m-%d %H:%M:%S)T,%.3s\n' ${EPOCHREALTIME/./ })
|
||||
@@ -141,6 +141,11 @@ if [[ -n "$SYNAPSE_RUST_SYNC" ]]; then
|
||||
sed -i "s/^experimental_features:$/experimental_features:\n rust_sync: \"$SYNAPSE_RUST_SYNC\"/" /conf/shared.yaml.j2
|
||||
fi
|
||||
|
||||
# Compute sliding sync responses in Rust (`experimental_features.rust_sliding_sync`).
|
||||
if [[ -n "$SYNAPSE_RUST_SLIDING_SYNC" ]]; then
|
||||
sed -i "s/^experimental_features:$/experimental_features:\n rust_sliding_sync: \"$SYNAPSE_RUST_SLIDING_SYNC\"/" /conf/shared.yaml.j2
|
||||
fi
|
||||
|
||||
# Add a directory for tests to add config overrides if they want
|
||||
mkdir --parents /conf/homeserver.d
|
||||
export _SYNAPSE_COMPLEMENT_EXTRA_CONFIG_DIR=/conf/homeserver.d
|
||||
|
||||
Reference in new issue
Block a user