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 restore mail (rbox_sync) #215

Closed
jrse opened this issue Nov 23, 2018 · 1 comment
Closed

doveadm force-resync restore mail (rbox_sync) #215

jrse opened this issue Nov 23, 2018 · 1 comment
Assignees
Labels

Comments

@jrse
Copy link
Contributor

jrse commented Nov 23, 2018

Describe the bug

Restored mail exists in 2 mailbox indices but only once in ceph!

To Reproduce
Steps to reproduce the behavior:

  1. use imap client to create a new mail and save in it in Drafts folder
  2. move mail to INBOX
  3. use doveadm force-resync -u INBOX to restore indices.
  4. check index of inbox and Drafts folder.

Expected behavior
Mail is only referenced in one mailbox. (we do not support references)

Logfiles, screenshots

doveadm rmb ls -u u1 -

time elapsed loading objects: 64
INDEX: Check
box: INBOX.Drafts
mails total: 1, missing mails in objectstore: 0
box: INBOX
mails total: 1, missing mails in objectstore: 0
box: INBOX.Trash
mails total: 0, missing mails in objectstore: 0
box: INBOX.Spam
mails total: 0, missing mails in objectstore: 0
box: INBOX.Sent
mails total: 0, missing mails in objectstore: 0
mailbox_count: 1

MAILBOX: M(mailbox_guid)=bf31ad1154bfee5bc42d0000d561c877
B(mailbox_orig_name)=Drafts
mail_total=1, mails_displayed=1
mailbox_size=9208787 bytes

     MAIL:   U(uid)=9
             oid = 9848e426abd1f75bb6770000d561c877
             R(receive_time)=2018-11-23 11:08:43
             save_time=2018-11-23 12:29:13
             Z(phy_size)=9208787 V(v_size) = 9334960 stat_size=9208787
             M(mailbox_guid)=bf31ad1154bfee5bc42d0000d561c877
             B(mailbox_orig_name)=Drafts
             G(mail_guid)=9948e426abd1f75bb6770000d561c877
             I(rbox_version): 0.1

Server (please complete the following information):

  • OS: ubuntu 18.04
  • Ceph Version [luminous]
  • Dovecot Version [e.g. 2.2]

Client (please complete the following information):

  • used client: thunderbird, doveadm rmb
@jrse jrse added the bug label Nov 23, 2018
@jrse jrse changed the title rbox_sync force-resyc restore mail doveadm force-resyc restore mail (rbox_sync) Nov 23, 2018
@jrse jrse changed the title doveadm force-resyc restore mail (rbox_sync) doveadm force-resync restore mail (rbox_sync) Nov 23, 2018
@jrse
Copy link
Contributor Author

jrse commented Nov 23, 2018

problem is in : rbox-sync-rebuild.cpp
in case the search for MailboxGUID returns empty Iterator an aditionaly search for objects with the mailboxname is done. (this will add the moved mail to drafts index again)

int search_objects(struct index_rebuild_context *ctx, struct rbox_sync_rebuild_ctx *rebuild_ctx);
librmb::RadosMetadata attr_guid(rbox_metadata_key::RBOX_METADATA_MAILBOX_GUID, guid);
librados::NObjectIterator iter_guid(storage->find_mails(&attr_guid));

if (iter_guid != librados::NObjectIterator::__EndObjectIterator) {
ret = rbox_sync_rebuild_entry(ctx, iter_guid, rebuild_ctx);
} else {
...
librmb::RadosMetadata attr_name(rbox_metadata_key::RBOX_METADATA_ORIG_MAILBOX, rbox->box.name);
// rebuild index.
librados::NObjectIterator iter_name(storage->find_mails(&attr_name));
ret = rbox_sync_rebuild_entry(ctx, iter_name, rebuild_ctx);
}

@jrse jrse self-assigned this Nov 23, 2018
jrse added a commit that referenced this issue Nov 26, 2018
… is now the only matching criteria. doveadm rmb check indices -u <user> will list all not assigned mail objects
@jrse jrse closed this as completed Nov 26, 2018
jrse added a commit that referenced this issue Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant