Skip to content
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

activity: when migrating, refresh summaries *once* #3570

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

Fang-
Copy link
Member

@Fang- Fang- commented Jun 5, 2024

Migration logic was calling into +update-index for each entry we imported, which in turn calls +refresh-summary. Of course, we know we'll likely be adding more things, so this is unnecessary (and slow) work.

Here, we add an importing flag into the context, and set it to true for the duration of migration logic. The should-notify hidden parameter we had added to the +add arm previously gets replaced by this, and if it's set to true, we don't run +refresh-summary for every invocation of +update-index.

This brings upgrade wall-clock time down from "idk, didn't finish in a reasonable timeframe" to a minute and a half, of which a full minute is spent on the activity agent's migration logic.

We could probably bring that down further, or at least reduce variance, by capping the amount of events we add per channel. Unclear whether that's desirable or not. The change here feels like 80% of the solution, at least.

Fixes TLON-1986

Migration logic was calling into +update-index for each entry we
imported, which in turn calls +refresh-summary. Of course, we know we'll
likely be adding more things, so this is unnecessary (and slow) work.

Here, we add an "importing" flag into the context, and set it to true
for the duration of migration logic. The "should-notify" hidden
parameter we had added to the +add arm previously gets replaced by this,
and if it's set to true, we don't run +refresh-summary for every
invocation of +update-index.

This brings upgrade wall-clock time down from "idk, didn't finish in a
reasonable timeframe" to a minute and a half, of which a full minute is
spent on the activity agent's migration logic.

We could probably bring that down further, or at least reduce variance,
by capping the amount of events we add per channel. Unclear whether
that's desirable or not. The change here feels like 80% of the solution,
at least.
@Fang- Fang- requested a review from arthyn June 5, 2024 16:09
Copy link
Member

@arthyn arthyn left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

linear bot commented Jun 5, 2024

@arthyn arthyn merged commit 2853814 into develop Jun 5, 2024
1 check failed
@arthyn arthyn deleted the m/faster-activity-migration branch June 5, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants