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
ctl_mboxlist dump/undump miss new fields #3896
Comments
There are recover (-r) and checkpoint (-c) implementations in here that have been "deprecated" in favour of ctl_cyrusdb since 2001, and aren't documented anywhere else. I'm gonna just rip them out while I'm in here. For some bizarre historical reason the dump implementation is deeply interwoven with the populate-mupdate implementation? So I guess I can see why this has been neglected so long, it's a mess. Gonna separate the two actions first, so when I refactor dump, I'm not tripping over unrelated mupdate stuff. |
It occurs to me that, since the dump loop is initiated by I think the right thing to do will be to cyrusdb_foreach over everything in there, and implement the dump/undump as dlist<->json converters? |
Though if the dump format has no semantics of its own and is just a direct json version of the internal dlist, then you wouldn't be able to use dump/undump to move data between versions, because no translation would occur along the way. Hmm. |
Given that this is If we do eventually want generic "dump/restore every key and value in this database, without regard for what they mean" actions, they should probably be in cyr_dbtool instead. |
The 3.4 version of this from #3384 has a bug: The trivial fix is to do something like
So anyway, we need to not produce "(null)", but if we produce empty fields instead then we need to adjust the parser. I think this can be addressed by switching the uniqueid field in the My WIP branch for getting this stuff ready for 3.4 is here: cyrus-imapd-3.4...elliefm:v34/3896-ctl_mboxlist-dump-undump |
ctl_mboxlist -d
dumps mailboxes.db to a flat file, andctl_mboxlist -u
undumps such a file into a new mailboxes.dbWe document these as the correct tools for doing conversions of mailboxes.db (e.g. "improved_mboxlist_sort" says it requires a dump/undump when changing its value).
However, since some version long ago (3.0 maybe? 2.5?) this tool has become stale. It does not know about all the things we store in mailboxes.db, and consequently that data is lost across a dump/undump.
There is already a fix for this for 3.4 in #3384, but 3.6 and master introduce additional new fields that this fix doesn't take into account, so it's already stale as soon as 3.6 lands. The new fields are multi-valued, so "just" extending this work to accommodate them will be quite complicated.
After some discussion at https://cyrus.topicbox.com/groups/devel/Tea9b3c8c5728d1e8-M7b68e56d5c41dafa2acbba63, the plan for 3.6 is to change the dump/undump format to use json and make sure all fields are properly dumped and undumped. Ideally we'll also preserve the ability to read the older format, if possible, so that people can dump/undump as part of an upgrade process if they wish (though they will still lose any data their older server failed to dump).
I expect to start working on this after the first 3.6 beta is released, but will intend to backport it into whichever 3.6 release comes out after it's done.
The text was updated successfully, but these errors were encountered: