baidu / baidu/bfs

Support append on existing file?

Open
#819 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.8k
Forks
551
PR merge metrics
No merged PRs in 30d

Description

Good job! I'm doing some webdav work on this fs.

I come to some problem that, when the webdav server handle some chunked-PUT request for some large file, it may write some segment file and then re-open it to append.

I found this in namespace.cc

`

if (exist) {
if ((flags & O_TRUNC) == 0) {
LOG(INFO, "CreateFile %s fail: already exist!", fname.c_str());
return kFileExists;
} else {
if (IsDir(file_info.type())) {
LOG(INFO, "CreateFile %s fail: directory with same name exist", fname.c_str());
return kFileExists;
}
for (int i = 0; i < file_info.blocks_size(); i++) {
blocks_to_remove->push_back(file_info.blocks(i));
}
}
}`
So this fs does not intend to support append operation on existing file?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in namespace.cc at the CreateFile logic shown in the issue, especially the existing-file and O_TRUNC branches. Determine the intended semantics for reopening an existing file to append data from chunked PUT requests; done requires an agreed append behavior and corresponding validation, but no test location is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.