Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
222990286
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
222990286
Commits
d2dbd6e6
Commit
d2dbd6e6
authored
2 years ago
by
baijiaruo
Browse files
Options
Downloads
Patches
Plain Diff
curvefs/client: fix client release read data cache core dump
parent
0700c938
No related branches found
Branches containing commit
Tags
v2.0.0-beta
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
curvefs/src/client/s3/client_s3_cache_manager.cpp
+12
-8
12 additions, 8 deletions
curvefs/src/client/s3/client_s3_cache_manager.cpp
curvefs/src/client/s3/client_s3_cache_manager.h
+1
-1
1 addition, 1 deletion
curvefs/src/client/s3/client_s3_cache_manager.h
with
13 additions
and
9 deletions
curvefs/src/client/s3/client_s3_cache_manager.cpp
+
12
−
8
View file @
d2dbd6e6
...
...
@@ -120,16 +120,17 @@ void FsCacheManager::Get(std::list<DataCachePtr>::iterator iter) {
lruReadDataCacheList_
,
iter
);
}
void
FsCacheManager
::
Delete
(
std
::
list
<
DataCachePtr
>::
iterator
iter
)
{
bool
FsCacheManager
::
Delete
(
std
::
list
<
DataCachePtr
>::
iterator
iter
)
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
lruMtx_
);
if
(
!
(
*
iter
)
->
InReadCache
())
{
return
;
return
false
;
}
(
*
iter
)
->
SetReadCacheState
(
false
);
lruByte_
-=
(
*
iter
)
->
GetActualLen
();
lruReadDataCacheList_
.
erase
(
iter
);
return
true
;
}
CURVEFS_ERROR
FsCacheManager
::
FsSync
(
bool
force
)
{
...
...
@@ -1249,8 +1250,9 @@ void ChunkCacheManager::AddReadDataCache(DataCachePtr dataCache) {
for
(
auto
key
:
deleteKeyVec
)
{
auto
iter
=
dataRCacheMap_
.
find
(
key
);
std
::
list
<
DataCachePtr
>::
iterator
dcpIter
=
iter
->
second
;
s3ClientAdaptor_
->
GetFsCacheManager
()
->
Delete
(
dcpIter
);
dataRCacheMap_
.
erase
(
iter
);
if
(
s3ClientAdaptor_
->
GetFsCacheManager
()
->
Delete
(
dcpIter
))
{
dataRCacheMap_
.
erase
(
iter
);
}
}
std
::
list
<
DataCachePtr
>::
iterator
outIter
;
bool
ret
=
...
...
@@ -1287,9 +1289,10 @@ void ChunkCacheManager::ReleaseCache() {
WriteLockGuard
writeLockGuard
(
rwLockRead_
);
auto
iter
=
dataRCacheMap_
.
begin
();
for
(;
iter
!=
dataRCacheMap_
.
end
();
iter
++
)
{
s3ClientAdaptor_
->
GetFsCacheManager
()
->
Delete
(
iter
->
second
);
if
(
s3ClientAdaptor_
->
GetFsCacheManager
()
->
Delete
(
iter
->
second
))
{
dataRCacheMap_
.
erase
(
iter
);
}
}
dataRCacheMap_
.
clear
();
}
void
ChunkCacheManager
::
TruncateCache
(
uint64_t
chunkPos
)
{
...
...
@@ -1331,8 +1334,9 @@ void ChunkCacheManager::TruncateReadCache(uint64_t chunkPos) {
uint64_t
dcLen
=
(
*
rIter
->
second
)
->
GetLen
();
uint64_t
dcActualLen
=
(
*
rIter
->
second
)
->
GetActualLen
();
if
((
dcChunkPos
+
dcLen
)
>
chunkPos
)
{
s3ClientAdaptor_
->
GetFsCacheManager
()
->
Delete
(
rIter
->
second
);
dataRCacheMap_
.
erase
(
next
(
rIter
).
base
());
if
(
s3ClientAdaptor_
->
GetFsCacheManager
()
->
Delete
(
rIter
->
second
))
{
dataRCacheMap_
.
erase
(
next
(
rIter
).
base
());
}
}
else
{
break
;
}
...
...
This diff is collapsed.
Click to expand it.
curvefs/src/client/s3/client_s3_cache_manager.h
+
1
−
1
View file @
d2dbd6e6
...
...
@@ -324,7 +324,7 @@ class FsCacheManager {
bool
Set
(
DataCachePtr
dataCache
,
std
::
list
<
DataCachePtr
>::
iterator
*
outIter
);
void
Delete
(
std
::
list
<
DataCachePtr
>::
iterator
iter
);
bool
Delete
(
std
::
list
<
DataCachePtr
>::
iterator
iter
);
void
Get
(
std
::
list
<
DataCachePtr
>::
iterator
iter
);
CURVEFS_ERROR
FsSync
(
bool
force
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment