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

Warning: "Errorcode: %d cannot get x_attr(%s,%c) from object %s, process %d" #206

Closed
jrse opened this issue Nov 5, 2018 · 3 comments
Closed

Comments

@jrse
Copy link
Contributor

jrse commented Nov 5, 2018

**Concurrent read and delete for same object **

The sdbox / mdbox storage plugin, does detect (and sync) concurrent access to a mail object with a filelock. In Ceph is no similar mechanism for an object. So dependent on the actual test (number of users, concurrent users, type of mail operation, ...) the warning with errorcode -2 will occur and the mail object will be marked as expunged.

There is no easy/obvious solution to avoid this, but the timespan a index is locked or has unsaved modifications can be minimized.
e.g. closing the index, before executing / waiting for object deletion.

Discussions are welcome!

jrse added a commit that referenced this issue Nov 5, 2018
… all possible index operations first, before closing index
@jrse
Copy link
Contributor Author

jrse commented Nov 29, 2018

A workable solution may be using librados watch/notify mechanism.
It could be implemented in the following way:
rbox_mail.cpp creates at the first opportunity a watch on the mail object, it want's to read.
rbox_sync.cpp calls the notify (synchronous) method before deleting a mail object from the object store.

The sdbox implementation creates a file handle when reading metadata, save_date, get_stream and removes it in dbox_mail_close (sdbox_mail.c). sdbox_sync.c will wait with the deletion using unlink which blocks until all file handler are removed before deleting a file.

@jrse
Copy link
Contributor Author

jrse commented Nov 29, 2018

librados create watcher:

rados_watch2(io, object,&cookie, watch_notify2_cb, watch_notify2_errcb,NULL);

wather callbacks:
void watch_notify2_cb(void *arg, uint64_t notify_id, uint64_t cookie, uint64_t notifier_gid, void *data,size_t data_len);
void watch_notify2_errcb(void *arg, uint64_t cookie, int err);

notify:
rados_notify2(rados_ioctx_t io, const char * o, const char * buf, int buf_len, uint64_t timeout_ms, char ** reply_buffer, size_t * reply_buffer_len)

see: http://docs.ceph.com/docs/jewel/rados/api/librados/

@jrse
Copy link
Contributor Author

jrse commented Feb 27, 2019

  • re implement the mail index with appropriate sync mechanism.

-> more tests under heavy load required to determine scope of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant