Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curvefs/metaserver: fix trash bugs #2929

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8007e9a
[fix]tools-v2: add version in function NewQuerySubUri
baytan0720 Nov 3, 2023
9b4f5a8
Fix metaserver deadlock caused by bthread coroutine switching
wu-hanqing Oct 31, 2023
182dccc
curvefs/client: fix memory leak of memcached
wuhongsong Nov 6, 2023
0630b93
curvefs/client: fix unittest failed
wuhongsong Nov 7, 2023
f2327b8
docker: added dockerfile for build in ubuntu22.
Wine93 Nov 1, 2023
ca0db64
build: fixed missing some compile params for building curvefs sdk.
Wine93 Nov 1, 2023
68e5602
curvefs/sdk: add maven build plugin,optimize the logic of parsing inp…
fine97 Nov 8, 2023
e425a33
[fix]curvefs/client: warmup process
Cyber-SiKu Nov 8, 2023
dcc26bd
tools-v2: fix update fs bug
h0hmj Nov 10, 2023
fabdfb9
[fix]curvefs/client: diskcache may deadlock
Cyber-SiKu Nov 10, 2023
49c696e
fix(util): stop write log to stderr, when FLAGS_logtostderr is false
NaturalSelect Nov 9, 2023
71af015
add bs stop snapshot
ZackSoul Nov 2, 2023
a11c112
[fix] curvefs: mds: createfs error
201341 Oct 10, 2023
54ca490
curvefs/client: too many logs
wuhongsong Nov 16, 2023
94c4621
[feat] curvefs: merge two rpc into one when delete dentry
201341 Sep 7, 2023
c34c6a9
[fix] fix entrypoint bug for monitor role
caoxianfei1 Nov 16, 2023
4c97003
[fix]tools-v2: panic when show cluster status
montaguelhz Nov 12, 2023
82dd8c9
fix read config
Ziy1-Tan Nov 18, 2023
230916f
[fix] fix the error that modify diskTrimCheckIntervalSec on the fly
caoxianfei1 Nov 17, 2023
f791d01
script: fix typo.
Wine93 Nov 19, 2023
0700dae
curvefs/client: fix the delayed inode not being retrieved in nocto sc…
Wine93 Nov 19, 2023
b37bd14
fix ut test bug
YunhuiChen Nov 20, 2023
ffaba4a
change docs website
aspirer Nov 21, 2023
6a84c18
doc: add changelog for v2.7.
Wine93 Nov 20, 2023
9eeec03
Update CHANGELOG-2.7.md
aspirer Nov 22, 2023
0625666
update curve-arch.png
aspirer Nov 22, 2023
7cb5bd1
curvefs/metaserver: fix trash bugs
wuhongsong Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .obm.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
container_name: curve-build-playground.master
container_image: opencurvedocker/curve-base:build-debian11
container_image: opencurvedocker/curve-build:ubuntu22
5 changes: 5 additions & 0 deletions CHANGELOG-2.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG of v2.7

[CHANGELOG-2.7](https://docs.opencurve.io/Release/release-notes-v2.7)

> NOTE: All release notes will be published on our documents site from now on.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
**A sandbox project hosted by the CNCF Foundation**

#### English | [简体中文](README_cn.md)
### 📄 [Documents](https://github.com/opencurve/curve/tree/master/docs) || 🌐 [Official Website](https://www.opencurve.io/Curve/HOME) || 🏠 [Forum](https://ask.opencurve.io/t/topic/7)
### 📄 [Documents](https://docs.opencurve.io/) || 🌐 [Official Website](https://www.opencurve.io/Curve/HOME) || 🏠 [Forum](https://ask.opencurve.io/t/topic/7)
<div align=left>

<div class="column" align="middle">
Expand Down
2 changes: 1 addition & 1 deletion README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
**CNCF基金会的沙箱托管项目**

#### [English](README.md) | 简体中文
### 📄 [文档](https://github.com/opencurve/curve/tree/master/docs) || 🌐 [官网](https://www.opencurve.io/Curve/HOME) || 🏠 [论坛](https://ask.opencurve.io/t/topic/7)
### 📄 [文档](https://docs.opencurve.io/) || 🌐 [官网](https://www.opencurve.io/Curve/HOME) || 🏠 [论坛](https://ask.opencurve.io/t/topic/7)
<div align=left>

<div class="column" align="middle">
Expand Down
2 changes: 1 addition & 1 deletion curvefs/devops/util/tmpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Usage:
# tmpl.sh DSV SOURCE DESTINATION
# Example:
# tmpl.sh = /usr/local/metaserver.conf /tmp/metaserver.con
# tmpl.sh = /usr/local/metaserver.conf /tmp/metaserver.conf

g_dsv=$1
g_src=$2
Expand Down
5 changes: 4 additions & 1 deletion curvefs/docker/debian11/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ function prepare() {
}

function create_directory() {
chmod 700 "$g_prefix/data"
if [ "$g_role" != "monitor" ]; then
chmod 700 "$g_prefix/data"
fi

if [ "$g_role" == "etcd" ]; then
mkdir -p "$g_prefix/data/wal"
elif [ "$g_role" == "metaserver" ]; then
Expand Down
5 changes: 4 additions & 1 deletion curvefs/docker/openeuler/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ function prepare() {
}

function create_directory() {
chmod 700 "$g_prefix/data"
if [ "$g_role" != "monitor" ]; then
chmod 700 "$g_prefix/data"
fi

if [ "$g_role" == "etcd" ]; then
mkdir -p "$g_prefix/data/wal"
elif [ "$g_role" == "metaserver" ]; then
Expand Down
1 change: 1 addition & 0 deletions curvefs/proto/metaserver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ message DeleteDentryRequest {
required uint64 parentInodeId = 6;
required string name = 7;
optional FsFileType type = 8;
optional Time create = 9;
}

message DeleteDentryResponse {
Expand Down
6 changes: 3 additions & 3 deletions curvefs/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ How to build

``` bash
$ git clone [email protected]:opencurve/curve.git
$ cd curve
$ make dep stor=fs
$ make playground
$ make ci-dep stor=fs
$ make sdk
```

It will generate a jar after build success:
It will generate a jar package after build success:

```
Build SDK success => /curve/curvefs/sdk/output/curvefs-hadoop-1.0-SNAPSHOT.jar
Expand Down
2 changes: 2 additions & 0 deletions curvefs/sdk/java/native/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ cc_binary(
copts = CURVE_DEFAULT_COPTS,
linkopts = [
"-Wl,-rpath=/tmp/libcurvefs,--disable-new-dtags",
"-L/usr/lib/x86_64-linux-gnu/",
"-lhashkit",
],
deps = [
"@com_google_absl//absl/cleanup",
Expand Down
18 changes: 18 additions & 0 deletions curvefs/sdk/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,25 @@
<resource>
<directory>native/build</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2023 NetEase Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.opencurve.curve.fs.flink;

import io.opencurve.curve.fs.hadoop.CurveFileSystem;
Expand All @@ -10,28 +26,17 @@
import java.net.URI;

public class CurveFileSystemFactory implements FileSystemFactory {
private org.apache.hadoop.conf.Configuration conf;

private org.apache.hadoop.conf.Configuration conf = new Configuration();
private static final String CURVE_FS_CONFIG_PREFIXES = "curvefs.";
private static final String FLINK_CONFIG_PREFIXES = "fs.";
public static String SCHEME = "curvefs";

@Override
public void configure(org.apache.flink.configuration.Configuration config) {
conf = new Configuration();
if (config != null) {
for (String key : config.keySet()) {
if (key.startsWith(CURVE_FS_CONFIG_PREFIXES) || key.startsWith(FLINK_CONFIG_PREFIXES)) {
String value = config.getString(key, null);
if (value != null) {
if (CurveFileSystem.class.getCanonicalName().equals(value.trim())) {
SCHEME = key.split("\\.")[1];
}
conf.set(key, value);
}
}
}
}
config.keySet()
.stream()
.filter(key -> key.startsWith(CURVE_FS_CONFIG_PREFIXES) || key.startsWith(FLINK_CONFIG_PREFIXES))
.forEach(key -> conf.set(key, config.getString(key, "")));
}

@Override
Expand All @@ -45,4 +50,4 @@ public FileSystem create(URI uri) throws IOException {
fs.initialize(uri, conf);
return new HadoopFileSystem(fs);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2023 NetEase Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.opencurve.curve.fs.flink;

import org.apache.flink.connector.file.table.FileSystemTableFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public class CurveFSInputStream extends FSInputStream {
*/
public CurveFSInputStream(Configuration conf, CurveFSProto curvefs,
int fh, long flength, int bufferSize) {
// Whoever's calling the constructor is responsible for doing the actual curve_open
// call and providing the file handle.
fileLength = flength;
fileHandle = fh;
closed = false;
Expand All @@ -73,6 +71,7 @@ public CurveFSInputStream(Configuration conf, CurveFSProto curvefs,
/** Curve likes things to be closed before it shuts down,
* so closing the IOStream stuff voluntarily in a finalizer is good
*/
@Override
protected void finalize() throws Throwable {
try {
if (!closed) {
Expand All @@ -91,7 +90,6 @@ private synchronized boolean fillBuffer() throws IOException {

bufValid = 0;

// attempt to reset to old position. If it fails, too bad.
curve.lseek(fileHandle, curvePos, CurveFSMount.SEEK_SET);
throw new IOException("Failed to fill read buffer! Error code:" + err);
}
Expand All @@ -102,6 +100,7 @@ private synchronized boolean fillBuffer() throws IOException {
/*
* Get the current position of the stream.
*/
@Override
public synchronized long getPos() throws IOException {
return curvePos - bufValid + bufPos;
}
Expand All @@ -117,6 +116,7 @@ public synchronized int available() throws IOException {
return (int) (fileLength - getPos());
}

@Override
public synchronized void seek(long targetPos) throws IOException {
LOG.trace("CurveInputStream.seek: Seeking to position " + targetPos + " on fd "
+ fileHandle);
Expand All @@ -142,6 +142,7 @@ public synchronized void seek(long targetPos) throws IOException {
* they'll be dealt with before anybody even tries to call this method!
* @return false.
*/
@Override
public synchronized boolean seekToNewSource(long targetPos) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.opencurve.curve.fs.libfs.CurveFSStat;
import io.opencurve.curve.fs.libfs.CurveFSStatVFS;

import java.util.UUID;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
Expand All @@ -37,6 +38,7 @@
class CurveFSTalker extends CurveFSProto {
private CurveFSMount mount;
private String fsname = null;
private String mountpoint = null;
private boolean inited = false;

private static final String PREFIX_KEY = "curvefs";
Expand Down Expand Up @@ -72,14 +74,15 @@ void initialize(URI uri, Configuration conf) throws IOException {
if (null == fsname || fsname.isEmpty()) {
throw new IOException("curvefs.name is not set");
}
mount.mount(fsname, "/");
mountpoint = UUID.randomUUID().toString();
mount.mount(fsname, mountpoint);
inited = true;
}

@Override
void shutdown() throws IOException {
if (inited) {
mount.umount(fsname, "/");
mount.umount(fsname, mountpoint);
mount = null;
inited = false;
}
Expand Down Expand Up @@ -179,4 +182,4 @@ void chown(Path path, int uid, int gid) throws IOException {
void rename(Path src, Path dst) throws IOException {
mount.rename(tostr(src), tostr(dst));
}
}
}
Loading
Loading