-
Notifications
You must be signed in to change notification settings - Fork 7
Prevent event reindexing (on same HS) by only allowing a cursor to change incrementally #662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
42ac573
0691214
da5e471
673053b
69b8a61
58724ea
f3d3c0a
d36b923
d70e8c5
21e63be
c9c5a94
dc4b20b
b87f635
aa09a57
2a665db
763c399
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,7 +113,7 @@ impl EventProcessor { | |
|
|
||
| if let Some(cursor) = line.strip_prefix("cursor: ") { | ||
| info!("Received cursor for the next request: {cursor}"); | ||
| match Homeserver::try_from_cursor(id, cursor) { | ||
| match Homeserver::try_from_cursor(id, cursor).await { | ||
| Ok(hs) => hs.put_to_index().await?, | ||
| Err(e) => warn!("{e}"), | ||
|
Contributor
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. Now this is going to fail each time, unless homeserver somehow returns cursor that is higher that currently stored. Should we have a metric and get notified that syncing is stalled because of it ?
Contributor
Author
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. If the HS returns event lines, the last one will have a cursor that is higher than given cursor. For example https://homeserver.pubky.app/events/?cursor=150000&limit=1 If the given cursor doesn't exist, the HS returns no lines : https://homeserver.pubky.app/events/?cursor=250000&limit=1
So it seems to me the condition you describe won't happen, because the HS always returns a higher cursor than the current one (arg), else returns no lines at all. Or am I missing smth? |
||
| } | ||
|
|
||
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.
Have you considered migrating data in redis instead of supporting both formats ?