-
Notifications
You must be signed in to change notification settings - Fork 882
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
optionally turn off 'S3Disable100Continue' via url query parameter #3228
Conversation
可以怎么复现这个问题? |
Codecov ReportBase: 55.70% // Head: 55.54% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #3228 +/- ##
==========================================
- Coverage 55.70% 55.54% -0.17%
==========================================
Files 142 142
Lines 33048 33145 +97
==========================================
Hits 18410 18410
- Misses 12698 12788 +90
- Partials 1940 1947 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
选型: 步骤:
weed -v=1 server -ip.bind=0.0.0.0 -master.volumeSizeLimitMB=1 -master.volumePreallocate=false -master=true -volume=true -filer=true -s3=true -s3.config=identity.json -iam=false -webdav=false -volume.max=1 同目录下需要两个配置文件 [mysql2] # or memsql, tidb
enabled = true
createTable = """
CREATE TABLE IF NOT EXISTS `%s` (
dirhash BIGINT,
name VARCHAR(1000) BINARY,
directory TEXT BINARY,
meta LONGBLOB,
PRIMARY KEY (dirhash, name)
) DEFAULT CHARSET=utf8;
"""
hostname = "localhost"
port = 3306
username = "root"
password = "6789"
database = "s3" # create or use an existing database
connection_max_idle = 2
connection_max_open = 100
connection_max_lifetime_seconds = 0
interpolateParams = false
# if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax:
enableUpsert = true
upsertQuery = """INSERT INTO `%s` (dirhash,name,directory,meta) VALUES(?,?,?,?) ON DUPLICATE KEY UPDATE meta = VALUES(meta)""" identity.json {
"identities": [
{
"name": "admin",
"accountId": "admin",
"credentials": [
{
"access_key": "AKIARVTQO2DJNBALAG2Y",
"secret_key": "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"
}
],
"actions": [
"Admin",
"Read",
"Write",
"List"
]
}
]
}
dd if=/dev/zero of=50m bs=10m count=5
|
问题复现三个条件:
|
明白了。如果默认去掉 100-continue, 有什么不好的呢?感觉是当没有授权时,可能会浪费带宽?对方访问正常(aws 的 s3 服务),可以用 objbench 测试下有没有性能影响。 目前看起来只对某些s3后端有影响,可能通过 url query 来可选地关闭它比较合适。 |
的确有可能会浪费带宽如果没有授权 如果可选的话当然更好,怎么 url query 来控制的? |
endpoint 是 一个 url ,可以参考 tikv.go 里解析 query 的做法 |
好办法,你看看有什么需要修改的吗 |
问题:
aws-sdk-go 客户端上传文件到 s3 时,如果文件大于 2m 会自动加上请求头 Expect: '100-Continue',但http规范 Expect 的值是 '100-continue' (大小写不一样)
如果请求发生重试,aws-sdk-go 会讲 Expect header 请求头用作签名,由于上面大小写问题,如果对象存储在验签时将 '100-continue' 作为 expect 的值,那么会导致签名校验失败
考虑上面原因 以及 juicefs 实际上传 s3 的都是分块文件比较下,所以这里将 expect 请求头禁用