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

doveadm force-resync does not work #61

Closed
jrse opened this issue Aug 10, 2017 · 1 comment
Closed

doveadm force-resync does not work #61

jrse opened this issue Aug 10, 2017 · 1 comment
Assignees

Comments

@jrse
Copy link
Contributor

jrse commented Aug 10, 2017

current implementation to rebuild index is based on sdbox. It needs to be rewritten to list all objects (mail) for given mailbox from rados and add each file to rebuild index again.

Note:

  • calling doveadm force-resync on valid index, will do nothing. Current behavior of force resync is to create backup of original index and log files. rebuild index is empty after force-resync.
  • attached you find t1's corrupt mailbox (unable to copy more than one mail from inbox to another folder)

The following function needs to be modified.

rbox-sync.cpp
static int rbox_sync_index_rebuild_dir(struct index_rebuild_context *ctx, const char *path, bool primary).
(based on sdbox-sync.cpp) sdbox_sync_index_rebuild....

t1_mailbox.tar.gz

@jrse
Copy link
Contributor Author

jrse commented Aug 16, 2017

rebuild of index is done in the following way:
doveadm force-resync -u
this will trigger the following process.

  1. mailbox.guid is determined (existing index file)
  2. resync search for all objects with attribute M=mailbox.guid
  3. resync loads all xattributes for each object.
  4. resync tries to find old index entry with xattribute.UID in backup index / log.
  5. resync restores index entry
  6. resync re-adds the extension header with oid and xattributes.guid

@jrse jrse self-assigned this Aug 16, 2017
@jrse jrse closed this as completed Aug 16, 2017
peter-mauritius pushed a commit that referenced this issue Sep 8, 2017
added support to repair corrupt index.
- all rados mail objects have xattr M = mailbox guid
- and mails uid 
- mailbox guid to restore is read from index header.
- using rados osd filter all mailobjects with mailbox guid and their
xattributes are read from rados.
- for each mail object a lookup with uid is done in cache and log to
restore index entry
 extended header (oid and guid) are add to index entry
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

No branches or pull requests

1 participant