Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
808f663e
Commit
808f663e
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Don't return state event outlier's when paginating.
parent
1317afcb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/storage/__init__.py
+6
-1
6 additions, 1 deletion
synapse/storage/__init__.py
synapse/storage/schema/im.sql
+1
-0
1 addition, 0 deletions
synapse/storage/schema/im.sql
synapse/storage/stream.py
+2
-1
2 additions, 1 deletion
synapse/storage/stream.py
with
9 additions
and
2 deletions
synapse/storage/__init__.py
+
6
−
1
View file @
808f663e
...
@@ -105,6 +105,11 @@ class DataStore(RoomMemberStore, RoomStore,
...
@@ -105,6 +105,11 @@ class DataStore(RoomMemberStore, RoomStore,
"
processed
"
:
True
,
"
processed
"
:
True
,
}
}
if
hasattr
(
event
,
"
outlier
"
):
vals
[
"
outlier
"
]
=
event
.
outlier
else
:
vals
[
"
outlier
"
]
=
False
if
backfilled
:
if
backfilled
:
if
not
self
.
min_token_deferred
.
called
:
if
not
self
.
min_token_deferred
.
called
:
yield
self
.
min_token_deferred
yield
self
.
min_token_deferred
...
@@ -123,7 +128,7 @@ class DataStore(RoomMemberStore, RoomStore,
...
@@ -123,7 +128,7 @@ class DataStore(RoomMemberStore, RoomStore,
except
:
except
:
logger
.
exception
(
logger
.
exception
(
"
Failed to persist, probably duplicate: %s
"
,
"
Failed to persist, probably duplicate: %s
"
,
event_id
event
.
event_id
)
)
return
return
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/schema/im.sql
+
1
−
0
View file @
808f663e
...
@@ -22,6 +22,7 @@ CREATE TABLE IF NOT EXISTS events(
...
@@ -22,6 +22,7 @@ CREATE TABLE IF NOT EXISTS events(
content
TEXT
NOT
NULL
,
content
TEXT
NOT
NULL
,
unrecognized_keys
TEXT
,
unrecognized_keys
TEXT
,
processed
BOOL
NOT
NULL
,
processed
BOOL
NOT
NULL
,
outlier
BOOL
NOT
NULL
,
CONSTRAINT
ev_uniq
UNIQUE
(
event_id
)
CONSTRAINT
ev_uniq
UNIQUE
(
event_id
)
);
);
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/stream.py
+
2
−
1
View file @
808f663e
...
@@ -177,6 +177,7 @@ class StreamStore(SQLBaseStore):
...
@@ -177,6 +177,7 @@ class StreamStore(SQLBaseStore):
"
((room_id IN (%(current)s)) OR
"
"
((room_id IN (%(current)s)) OR
"
"
(event_id IN (%(invites)s)))
"
"
(event_id IN (%(invites)s)))
"
"
AND e.stream_ordering > ? AND e.stream_ordering < ?
"
"
AND e.stream_ordering > ? AND e.stream_ordering < ?
"
"
AND e.outlier = 0
"
"
ORDER BY stream_ordering ASC LIMIT %(limit)d
"
"
ORDER BY stream_ordering ASC LIMIT %(limit)d
"
)
%
{
)
%
{
"
current
"
:
current_room_membership_sql
,
"
current
"
:
current_room_membership_sql
,
...
@@ -224,7 +225,7 @@ class StreamStore(SQLBaseStore):
...
@@ -224,7 +225,7 @@ class StreamStore(SQLBaseStore):
sql
=
(
sql
=
(
"
SELECT * FROM events
"
"
SELECT * FROM events
"
"
WHERE room_id = ? AND %(bounds)s
"
"
WHERE
outlier = 0 AND
room_id = ? AND %(bounds)s
"
"
ORDER BY topological_ordering %(order)s, stream_ordering %(order)s %(limit)s
"
"
ORDER BY topological_ordering %(order)s, stream_ordering %(order)s %(limit)s
"
)
%
{
"
bounds
"
:
bounds
,
"
order
"
:
order
,
"
limit
"
:
limit_str
}
)
%
{
"
bounds
"
:
bounds
,
"
order
"
:
order
,
"
limit
"
:
limit_str
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment