mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(client): update client first
with: #1000412030
Signed-off-by: clinx <chenlin1@oppo.com>
(cherry picked from commit c406e88c58)
This commit is contained in:
parent
846adfbad5
commit
a21a0b6b4c
@ -665,11 +665,16 @@ func (s *Streamer) doOverwrite(req *ExtentRequest, direct bool, storageClass uin
|
||||
// remote cache.Even if the random write fails, it won't cause the
|
||||
// remote cache to fail to cache the latest data.
|
||||
if s.enableRemoteCache() {
|
||||
// During LTP testing, it was observed that when performing overwrite writes,
|
||||
// the local file size is altered by metaNode from concurrent client reads,
|
||||
// causing the user-visible metadata to become inconsistent with the expected
|
||||
// actual file size. To prevent remote data from updating the local metadata,
|
||||
// the client increments the generation number (gen) in advance.
|
||||
s.extents.gen++
|
||||
err = s.client.metaWrapper.UpdateInodeMeta(s.inode)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
s.extents.gen++
|
||||
}
|
||||
|
||||
offset := req.FileOffset
|
||||
|
||||
Loading…
Reference in New Issue
Block a user