-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Data import between Zulip servers doesn't properly handle FillState #13486
Comments
Hello @zulip/server-misc members, this issue was labeled with the "area: export/import" label, so you may want to check it out! |
@zulipbot claim |
Hello @arpit551, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 14 days. You can reclaim this issue or claim any other issue by commenting Thanks for your contributions, and hope to see you again soon! |
@zulipbot still working |
@zulipbot claim |
Hello @arpit551, you claimed this issue to work on it, but this issue and any referenced pull requests haven't been updated for 10 days. Are you still working on this issue? If so, please update this issue by leaving a comment on this issue to let me know that you're still working on it. Otherwise, I'll automatically remove you from this issue in 4 days. If you've decided to work on something else, simply comment Thank you for your valuable contributions to Zulip! |
@zulipbot abandon |
FillState is handled according to the result of comparison between old server and new server. Also its compatibility with running update_count_stats is taken care by sharing the settings.ANALYTICS_LOCK_DIR lock with update_analytics_count.py and wait until it grabs the lock. Fixes zulip#13486
If you've exported data from an empty Zulip server and then import it into another empty Zulip server, you'll get the following exception when
manage.py update_analytics_counts return:
runs:The issue is that the RealmCount, UserCount, etc. analytics tables were imported, but the global
FillState
table that is supposed to keep track of which CountStat objects fromanalytics/lib/counts.py
have been properly updated cannot be readily imported in the general case, precisely because it is global. (The server we're importing into might be behind or more likely ahead of the server we're importing from, so there's no natural way to just copy the table).There's a few things we can do to fix this:
FillState
and then write a bit of code at the end of theimport_realm
to compare the old server's FillState to the new servers'. We can then do some of the following:analytics/lib/counts.py
to support passing aRealm
argument toprocess_count_stat
, which would cause that logic to run for just the target realm, and then have a little loop catch up the newly imported realm. Effectively, we'd need to support this alternative version of each of the queries we define:I think the right way to arrange that is to change the structure a bit to make e.g.
count_message_by_user_query
into a function like this:The text was updated successfully, but these errors were encountered: