Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
a20b0374
Unverified
Commit
a20b0374
authored
Jan 22, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_cache: Implement object deletion for FCO_READFAIL
parent
63412fa9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
fellow_cache.c
src/fellow_cache.c
+34
-2
No files found.
src/fellow_cache.c
View file @
a20b0374
...
...
@@ -5921,6 +5921,21 @@ fellow_cache_obj_wait_written(struct fellow_cache_obj *fco)
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
}
static
void
fellow_disk_obj_delete_thin
(
struct
fellow_fd
*
ffd
,
fellow_disk_block
start
,
const
uint8_t
hash
[
DIGEST_LEN
])
{
static
const
char
ndle
=
1
;
struct
fellow_dle
e
[
ndle
];
fellow_dle_init
(
e
,
ndle
);
e
->
type
=
DLEDSK
(
DLE_OBJ_DEL_THIN
);
memcpy
(
e
->
u
.
obj
.
hash
,
hash
,
(
size_t
)
DIGEST_LEN
);
e
->
u
.
obj
.
start
=
start
;
fellow_log_dle_submit
(
ffd
,
e
,
ndle
);
}
/* evict, then delete from log (this order is important to avoid
* fdb reuse)
*
...
...
@@ -5939,6 +5954,7 @@ fellow_cache_obj_delete(struct fellow_cache *fc,
struct
buddy_returns
*
rets
;
struct
buddy
*
dskbuddy
;
struct
stvfe_tune
*
tune
;
enum
fcos_state
state
;
enum
fcol_state
logstate
;
fellow_disk_block
fdba
;
unsigned
u
,
n
;
...
...
@@ -5994,6 +6010,7 @@ fellow_cache_obj_delete(struct fellow_cache *fc,
}
logstate
=
fco
->
logstate
;
state
=
FCO_STATE
(
fco
);
// must have been the last reference
AZ
(
fellow_cache_obj_deref_locked
(
lcb
,
fc
,
fco
));
...
...
@@ -6006,19 +6023,34 @@ fellow_cache_obj_delete(struct fellow_cache *fc,
case
FCOL_TOOLATE
:
break
;
case
FCOL_DELETED
:
/* if read failed, we do not have all regions, but the log might
* still work */
if
(
state
==
FCO_READFAIL
)
fellow_disk_obj_delete_thin
(
fc
->
ffd
,
fdba
,
hash
);
else
{
fellow_disk_obj_delete_submit
(
fc
->
ffd
,
fdba
,
hash
,
region
,
n
);
}
return
;
default:
WRONG
(
"fellow_cache_obj_delete logstate UNLOCKED"
);
}
/*
* NOTE: FOR FCO_READFAIL, we are likely to leak disk space
*
* When fellow_obj_regions() fails reading a segment list, we miss
* segments and, consequently, regions which the object occupies.
*/
/* XXX no async IO here yet: We need to free the dskbuddy space after
* the discard is complete. To do that, we would need to store the
* off/size of the discard in an additional structure of the io ring.
*
* we can not just hold the cache async io mtx because it would delay
* readahead
*
*/
assert
(
n
<
FCO_MAX_REGIONS
+
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment