fellow_log: Bring back obj deref during FP_INIT

8134e93b broke object deletions during
FP_INIT, because fellow_dskbuddy() waits for FP_OPEN:

 #3  0x00007f3f51a85d2b in fellow_wait_open (ffd=0x7f3f445a8000) at fellow_log.c:847
 #4  fellow_dskbuddy (ffd=0x7f3f445a8000) at fellow_log.c:6381
 #5  0x00007f3f51aa31f7 in fellow_cache_obj_delete (fc=0x7f3f446d4000, fco=<optimized out>,
     hash=hash@entry=0x7f3f404ce670 "ǹ\216N\032\217\230},p\245\205\361i \002\253\253Rn\372ز\303\307\355,\254\342\024\360M")
     at fellow_cache.c:6032
 #6  0x00007f3f51a597a9 in sfedsk_objfree (wrk=0x7f3f40dfc5d0, dskoc=0x7f3f404d5440) at fellow_storage.c:655
 #7  0x0000564d8e23c14a in ObjFreeObj (wrk=wrk@entry=0x7f3f40dfc5d0, oc=0x7f3f404d5440) at cache/cache_obj.c:412
 #8  0x0000564d8e232a9f in HSH_DerefObjCore (wrk=0x7f3f40dfc5d0, ocp=ocp@entry=0x7fffcd3303d0, rushmax=rushmax@entry=-1)
     at cache/cache_hash.c:1065
 #9  0x00007f3f51a5022f in festash_work_fes (fet=fet@entry=0x7fffcd33bbf0, fes=0x7f3e7a006640, ban=ban@entry=0x7ee790c56160)
     at fellow_stash.h:195
 #10 0x00007f3f51a54be2 in festash_top_work (fet=fet@entry=0x7fffcd33bbf0, has_bans=1) at fellow_stash.h:226
 #11 0x00007f3f51a586b8 in sfe_resurrect_ban (e=0x7f3e401d7c98, sfer=0x7fffcd33bbb0) at fellow_storage.c:2078
 #12 sfe_resurrect (priv=0x7fffcd33bbb0, e=0x7f3e401d7c98) at fellow_storage.c:2111
 #13 0x00007f3f51a81163 in fellow_logs_iter_block (flics=flics@entry=0x7fffcd332b80, flivs=flivs@entry=0x7fffcd337050,
     logblk=logblk@entry=0x7f3e401d7000) at fellow_log.c:4834
 #14 0x00007f3f51a82864 in fellow_logs_iter (flics=0x7fffcd332b80, flivs=flivs@entry=0x7fffcd337050, active_logregion=0x7f3f445a8360,
    empty_logregion=0x7f3f445a8370, off=594695172096, off@entry=656178581504) at fellow_log.c:5294
 #15 0x00007f3f51a84886 in fellow_logs_rewrite (ffd=ffd@entry=0x7f3f445a8000, new_log_fdr=new_log_fdr@entry=0x0,
     resur_f=resur_f@entry=0x7f3f51a57da0 <sfe_resurrect>, resur_priv=resur_priv@entry=0x7fffcd33bbb0) at fellow_log.c:5789
 #16 0x00007f3f51a8763b in fellow_log_open (ffd=0x7f3f445a8000, resur_f=resur_f@entry=0x7f3f51a57da0 <sfe_resurrect>,
     resur_priv=resur_priv@entry=0x7fffcd33bbb0) at fellow_log.c:6809
 #17 0x00007f3f51a5516a in sfe_open_task (priv=0x7fffcd33bbb0, wrk=<optimized out>) at fellow_storage.c:2199

But rather than bringing this back, we postpone deletion work with a
thin delete.
parent 67e9f228
......@@ -834,6 +834,14 @@ fellow_log_register_open_cb(struct fellow_fd *ffd,
ffd->open_cbs_n++;
}
int
fellow_is_open(const struct fellow_fd *ffd)
{
CHECK_OBJ_NOTNULL(ffd, FELLOW_FD_MAGIC);
return (ffd->phase == FP_OPEN);
}
static inline void
fellow_wait_open(struct fellow_fd *ffd)
{
......
......@@ -274,3 +274,4 @@ size_t fellow_log_freeing(struct fellow_fd *ffd);
#endif
void fellow_logwatcher_kick_locked(struct fellow_fd *ffd);
buddy_t *fellow_dskbuddy(struct fellow_fd *ffd);
int fellow_is_open(const struct fellow_fd *ffd);
......@@ -641,7 +641,7 @@ sfedsk_objfree(struct worker *wrk, struct objcore *dskoc)
AN(stvfe_oc_inlog(dskoc));
if (stvfe->membuddy->waiting) {
if (stvfe->membuddy->waiting || ! fellow_is_open(stvfe->ffd)) {
/* prio #1: memory shortage. get rid of the object
* without needing more memory */
stvfe_oc_dle_submit(stvfe->ffd, dskoc, DLE_OBJ_DEL_THIN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment