mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
Compare commits
47
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de34a1a87c | ||
|
|
c01fe1493d | ||
|
|
d1f503181b | ||
|
|
a5e8254ffd | ||
|
|
ab79d1f680 | ||
|
|
e8020910db | ||
|
|
c2b47967bd | ||
|
|
f09bc14165 | ||
|
|
69aa6d7adc | ||
|
|
5269d93fa8 | ||
|
|
7063b3e14c | ||
|
|
44e546a933 | ||
|
|
7d6c83b126 | ||
|
|
03388c4beb | ||
|
|
aceab0802e | ||
|
|
4b12af036c | ||
|
|
3c549b33ab | ||
|
|
f5fd5450d8 | ||
|
|
505049a4de | ||
|
|
d448e9db7b | ||
|
|
474a0713b0 | ||
|
|
d01ed36118 | ||
|
|
312cfe5ae1 | ||
|
|
b1fecf3b44 | ||
|
|
50464702d2 | ||
|
|
b452a5e41b | ||
|
|
0815ad78f6 | ||
|
|
edaee0e426 | ||
|
|
f46b2a1925 | ||
|
|
5a5cd15054 | ||
|
|
89ce6e175d | ||
|
|
b8cba2982c | ||
|
|
a0e278f86f | ||
|
|
e377149d39 | ||
|
|
4992ac1ca9 | ||
|
|
c191b2fe01 | ||
|
|
63a180ef75 | ||
|
|
88fd2d1be8 | ||
|
|
cc2775d9f2 | ||
|
|
846f9f7e7d | ||
|
|
196d4808a0 | ||
|
|
2a2ad05f1a | ||
|
|
b7be05fb41 | ||
|
|
2b2bbc625b | ||
|
|
a9de90ae29 | ||
|
|
4f692bf9c3 | ||
|
|
529ffa5c86 |
No files matched your search
@@ -27,7 +27,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4
|
||||
uses: github/codeql-action/init@v4.37.4
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: go
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below).
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v4
|
||||
uses: github/codeql-action/autobuild@v4.37.4
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
@@ -49,4 +49,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v4
|
||||
uses: github/codeql-action/analyze@v4.37.4
|
||||
@@ -135,14 +135,14 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -133,7 +133,7 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -221,13 +221,13 @@ jobs:
|
||||
buildkitd-config: /tmp/buildkitd.toml
|
||||
- name: Login to Docker Hub
|
||||
if: needs.setup.outputs.publish == 'true'
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Login to GHCR
|
||||
if: needs.setup.outputs.publish == 'true'
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -275,7 +275,7 @@ jobs:
|
||||
fi
|
||||
- name: Login to GHCR
|
||||
if: needs.setup.outputs.publish == 'true'
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -367,7 +367,7 @@ jobs:
|
||||
output: trivy-results.sarif
|
||||
exit-code: '0'
|
||||
- name: Upload Trivy scan results to GitHub Security
|
||||
uses: github/codeql-action/upload-sarif@v4
|
||||
uses: github/codeql-action/upload-sarif@v4.37.4
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
@@ -430,12 +430,12 @@ jobs:
|
||||
ghcr.io/chrislusf/seaweedfs
|
||||
tags: type=raw,value=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || 'latest' }},suffix=${{ steps.config.outputs.tag_suffix }}
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -219,7 +219,7 @@ jobs:
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.variant == 'all' || github.event.inputs.variant == matrix.variant
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -293,7 +293,7 @@ jobs:
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.variant == 'all' || github.event.inputs.variant == matrix.variant
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -310,7 +310,7 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.variant == 'all' || github.event.inputs.variant == matrix.variant
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
@@ -374,7 +374,7 @@ jobs:
|
||||
variant: large_disk
|
||||
steps:
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -400,7 +400,7 @@ jobs:
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security
|
||||
if: always()
|
||||
uses: github/codeql-action/upload-sarif@v4
|
||||
uses: github/codeql-action/upload-sarif@v4.37.4
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
category: trivy-${{ matrix.variant }}
|
||||
@@ -423,13 +423,13 @@ jobs:
|
||||
latest_tag: latest_large_disk
|
||||
steps:
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v4.5.1
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v1
|
||||
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -75,6 +75,39 @@ jobs:
|
||||
- name: Build
|
||||
run: cd weed; go build -tags "elastic gocdk sqlite ydb tarantool tikv rclone" -v .
|
||||
|
||||
build-cross:
|
||||
name: Build cross-platform (${{ matrix.goos }}/${{ matrix.goarch }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# One target's breakage should not hide the other three.
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { goos: windows, goarch: amd64 }
|
||||
- { goos: windows, goarch: arm64 }
|
||||
- { goos: freebsd, goarch: amd64 }
|
||||
- { goos: darwin, goarch: arm64 }
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
# Nothing else on a PR compiles these, so per-OS syscall constants creep
|
||||
# back into shared files unnoticed and only a release build catches it.
|
||||
- name: Cross-compile
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
run: |
|
||||
go build ./weed/...
|
||||
# Tests too: they reach for per-OS syscall constants the build does
|
||||
# not, and only compiling them catches an untagged one.
|
||||
go vet ./weed/mount/... ./weed/command/... 2>&1 |
|
||||
grep -v "MessageState contains sync.Mutex" | tee /tmp/vet.txt
|
||||
if grep -q "vet:" /tmp/vet.txt; then exit 1; fi
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
name: "mount: windows conformance"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/mount/**'
|
||||
- 'weed/command/mount*.go'
|
||||
- 'weed/storage/volume_vacuum*.go'
|
||||
- 'weed/storage/volume_loading.go'
|
||||
- 'weed/storage/disk_location.go'
|
||||
- 'test/winfsp-conformance/**'
|
||||
- '.github/workflows/mount-windows-conformance.yml'
|
||||
# No base branch filter: this is the only thing that runs the Windows mount,
|
||||
# so it should cover a pull request stacked on another one too.
|
||||
pull_request:
|
||||
paths:
|
||||
- 'weed/mount/**'
|
||||
- 'weed/command/mount*.go'
|
||||
- 'weed/storage/volume_vacuum*.go'
|
||||
- 'weed/storage/volume_loading.go'
|
||||
- 'weed/storage/disk_location.go'
|
||||
- 'test/winfsp-conformance/**'
|
||||
- '.github/workflows/mount-windows-conformance.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
conformance:
|
||||
name: WinFsp conformance
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
# The runner ships MinGW, so cgo is on by default and cgofuse picks its
|
||||
# cgo variant, which wants WinFsp's headers. The nocgo variant loads
|
||||
# winfsp-x64.dll at run time instead, which is how weed.exe is released.
|
||||
CGO_ENABLED: 0
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
# cgofuse loads winfsp-x64.dll at run time, so WinFsp is needed here but
|
||||
# not to build.
|
||||
- name: Install WinFsp
|
||||
run: choco install winfsp -y --no-progress
|
||||
|
||||
- name: Build weed.exe
|
||||
run: go build -o weed.exe ./weed
|
||||
|
||||
# The runner tears down a step's process tree when its shell exits, so a
|
||||
# cluster started in one step is gone by the next. Everything that needs
|
||||
# the cluster and the mount alive has to share a step.
|
||||
- name: Mount and run winfsp-tests
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
function Test-Port($port) {
|
||||
# A plain connect, because Test-NetConnection has reported success
|
||||
# here for a port nothing was listening on.
|
||||
$client = New-Object System.Net.Sockets.TcpClient
|
||||
try { $client.Connect('127.0.0.1', $port); return $client.Connected }
|
||||
catch { return $false }
|
||||
finally { $client.Dispose() }
|
||||
}
|
||||
|
||||
function Start-Mount($log) {
|
||||
Start-Process -FilePath .\weed.exe `
|
||||
-ArgumentList '-logtostderr','mount','-filer=127.0.0.1:8888','-dir=S:' `
|
||||
-RedirectStandardOutput "C:\$log.log" -RedirectStandardError "C:\$log.err.log"
|
||||
$deadline = (Get-Date).AddMinutes(2)
|
||||
while ((Get-Date) -lt $deadline) {
|
||||
if (Test-Path S:\) { Write-Host "S: is mounted"; return }
|
||||
Start-Sleep -Seconds 2
|
||||
}
|
||||
Get-Content "C:\$log.log", "C:\$log.err.log" -ErrorAction SilentlyContinue
|
||||
throw "S: never appeared"
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\seaweed-data | Out-Null
|
||||
# -ip pins the cluster to loopback; it otherwise advertises and binds
|
||||
# the runner's LAN address, which 127.0.0.1 cannot reach.
|
||||
Start-Process -FilePath .\weed.exe `
|
||||
-ArgumentList '-logtostderr','mini','-dir=C:\seaweed-data','-ip=127.0.0.1' `
|
||||
-RedirectStandardOutput C:\seaweed-mini.log -RedirectStandardError C:\seaweed-mini.err.log
|
||||
|
||||
$deadline = (Get-Date).AddMinutes(3)
|
||||
while ((Get-Date) -lt $deadline) {
|
||||
# The mount dials grpc, not http, so both ports have to answer.
|
||||
if ((Test-Port 8888) -and (Test-Port 18888)) { break }
|
||||
Start-Sleep -Seconds 3
|
||||
}
|
||||
if (-not ((Test-Port 8888) -and (Test-Port 18888))) {
|
||||
Get-Content C:\seaweed-mini.log, C:\seaweed-mini.err.log -ErrorAction SilentlyContinue
|
||||
throw "filer never came up"
|
||||
}
|
||||
Write-Host "filer is up on http 8888 and grpc 18888"
|
||||
|
||||
Start-Mount 'seaweed-mount'
|
||||
|
||||
Write-Host "::group::winfsp-tests"
|
||||
& pwsh -File test/winfsp-conformance/run.ps1 -MountPoint S:\
|
||||
$code = $LASTEXITCODE
|
||||
Write-Host "::endgroup::"
|
||||
if ($code -ne 0) { throw "winfsp-tests failed with exit $code" }
|
||||
|
||||
- name: Logs
|
||||
if: always()
|
||||
shell: pwsh
|
||||
run: |
|
||||
foreach ($f in 'C:\seaweed-mount.log','C:\seaweed-mount.err.log','C:\seaweed-mini.log','C:\seaweed-mini.err.log') {
|
||||
if (Test-Path $f) { Write-Host "===== $f"; Get-Content $f -Tail 200 }
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
name: "mount: windows"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/mount/**'
|
||||
- 'weed/command/mount*.go'
|
||||
- 'weed/storage/volume_vacuum*.go'
|
||||
- 'weed/storage/volume_loading.go'
|
||||
- 'weed/storage/disk_location.go'
|
||||
- 'test/winfsp/**'
|
||||
- '.github/workflows/mount-windows.yml'
|
||||
# No base branch filter: this is the only thing that runs the Windows mount,
|
||||
# so it should cover a pull request stacked on another one too.
|
||||
pull_request:
|
||||
paths:
|
||||
- 'weed/mount/**'
|
||||
- 'weed/command/mount*.go'
|
||||
- 'weed/storage/volume_vacuum*.go'
|
||||
- 'weed/storage/volume_loading.go'
|
||||
- 'weed/storage/disk_location.go'
|
||||
- 'test/winfsp/**'
|
||||
- '.github/workflows/mount-windows.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
mount-windows:
|
||||
name: Mount on Windows
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 40
|
||||
env:
|
||||
# The runner ships MinGW, so cgo is on by default and cgofuse picks its
|
||||
# cgo variant, which wants WinFsp's headers. The nocgo variant loads
|
||||
# winfsp-x64.dll at run time instead, which is how weed.exe is released.
|
||||
CGO_ENABLED: 0
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
# cgofuse loads winfsp-x64.dll at run time, so WinFsp is needed here but
|
||||
# not to build.
|
||||
- name: Install WinFsp
|
||||
run: choco install winfsp -y --no-progress
|
||||
|
||||
- name: Build weed.exe
|
||||
run: go build -o weed.exe ./weed
|
||||
|
||||
# The runner tears down a step's process tree when its shell exits, so a
|
||||
# cluster started in one step is gone by the next. Everything that needs
|
||||
# the cluster and the mount alive has to share a step.
|
||||
- name: Mount and exercise
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
function Test-Port($port) {
|
||||
# A plain connect, because Test-NetConnection has reported success
|
||||
# here for a port nothing was listening on.
|
||||
$client = New-Object System.Net.Sockets.TcpClient
|
||||
try { $client.Connect('127.0.0.1', $port); return $client.Connected }
|
||||
catch { return $false }
|
||||
finally { $client.Dispose() }
|
||||
}
|
||||
|
||||
function Start-Mount($log) {
|
||||
Start-Process -FilePath .\weed.exe `
|
||||
-ArgumentList '-logtostderr','mount','-filer=127.0.0.1:8888','-dir=S:' `
|
||||
-RedirectStandardOutput "C:\$log.log" -RedirectStandardError "C:\$log.err.log"
|
||||
$deadline = (Get-Date).AddMinutes(2)
|
||||
while ((Get-Date) -lt $deadline) {
|
||||
if (Test-Path S:\) { Write-Host "S: is mounted"; return }
|
||||
Start-Sleep -Seconds 2
|
||||
}
|
||||
Get-Content "C:\$log.log", "C:\$log.err.log" -ErrorAction SilentlyContinue
|
||||
throw "S: never appeared"
|
||||
}
|
||||
|
||||
function Stop-Mount {
|
||||
Get-CimInstance Win32_Process -Filter "Name = 'weed.exe'" |
|
||||
Where-Object { $_.CommandLine -like '*mount*' } |
|
||||
ForEach-Object { Stop-Process -Id $_.ProcessId -Force }
|
||||
$deadline = (Get-Date).AddMinutes(1)
|
||||
while ((Get-Date) -lt $deadline -and (Test-Path S:\)) { Start-Sleep -Seconds 2 }
|
||||
if (Test-Path S:\) { throw "S: still present after stopping the mount" }
|
||||
Write-Host "unmounted"
|
||||
}
|
||||
|
||||
function Invoke-Tests($label, [string[]]$goArgs) {
|
||||
Write-Host "::group::$label"
|
||||
& go @goArgs
|
||||
$code = $LASTEXITCODE
|
||||
Write-Host "::endgroup::"
|
||||
if ($code -ne 0) { throw "$label failed with exit $code" }
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\seaweed-data | Out-Null
|
||||
# -ip pins the cluster to loopback; it otherwise advertises and binds
|
||||
# the runner's LAN address, which 127.0.0.1 cannot reach.
|
||||
Start-Process -FilePath .\weed.exe `
|
||||
-ArgumentList '-logtostderr','mini','-dir=C:\seaweed-data','-ip=127.0.0.1' `
|
||||
-RedirectStandardOutput C:\seaweed-mini.log -RedirectStandardError C:\seaweed-mini.err.log
|
||||
|
||||
$deadline = (Get-Date).AddMinutes(3)
|
||||
while ((Get-Date) -lt $deadline) {
|
||||
# The mount dials grpc, not http, so both ports have to answer.
|
||||
if ((Test-Port 8888) -and (Test-Port 18888)) { break }
|
||||
Start-Sleep -Seconds 3
|
||||
}
|
||||
if (-not ((Test-Port 8888) -and (Test-Port 18888))) {
|
||||
Get-Content C:\seaweed-mini.log, C:\seaweed-mini.err.log -ErrorAction SilentlyContinue
|
||||
throw "filer never came up"
|
||||
}
|
||||
Write-Host "filer is up on http 8888 and grpc 18888"
|
||||
|
||||
Start-Mount 'seaweed-mount'
|
||||
|
||||
Invoke-Tests 'exercise' @('test','-v','-timeout','20m','./test/winfsp','-mountpoint=S:\')
|
||||
Invoke-Tests 'persist-write' @('test','-v','-timeout','15m','./test/winfsp','-run','TestPersistence','-mountpoint=S:\','-phase=write','-filer=127.0.0.1:8888')
|
||||
|
||||
Stop-Mount
|
||||
Start-Mount 'seaweed-remount'
|
||||
|
||||
Invoke-Tests 'persist-verify' @('test','-v','-timeout','15m','./test/winfsp','-run','TestPersistence','-mountpoint=S:\','-phase=verify')
|
||||
|
||||
# WinFsp creates the mount directory itself, so the path must not
|
||||
# exist; only its parent has to.
|
||||
Write-Host "::group::mount over a directory"
|
||||
Stop-Mount
|
||||
Remove-Item C:\seaweed-mnt -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Start-Process -FilePath .\weed.exe `
|
||||
-ArgumentList '-logtostderr','mount','-filer=127.0.0.1:8888','-dir=C:\seaweed-mnt' `
|
||||
-RedirectStandardOutput C:\seaweed-dirmount.log -RedirectStandardError C:\seaweed-dirmount.err.log
|
||||
$deadline = (Get-Date).AddMinutes(2)
|
||||
$ok = $false
|
||||
while ((Get-Date) -lt $deadline) {
|
||||
# Listing succeeds on the plain empty directory too, so wait for the
|
||||
# reparse point WinFsp turns it into. Otherwise this step passes
|
||||
# without a mount and writes to local disk.
|
||||
$item = Get-Item C:\seaweed-mnt -Force -ErrorAction SilentlyContinue
|
||||
if ($null -ne $item -and $item.Attributes.ToString() -like '*ReparsePoint*') { $ok = $true; break }
|
||||
Start-Sleep -Seconds 2
|
||||
}
|
||||
if (-not $ok) {
|
||||
Get-Content C:\seaweed-dirmount.log, C:\seaweed-dirmount.err.log -ErrorAction SilentlyContinue
|
||||
throw "mounting over a directory failed"
|
||||
}
|
||||
Set-Content -Path C:\seaweed-mnt\dirmount.txt -Value 'via directory mount'
|
||||
if ((Get-Content C:\seaweed-mnt\dirmount.txt) -ne 'via directory mount') { throw "readback through the directory mount differs" }
|
||||
Remove-Item C:\seaweed-mnt\dirmount.txt -Force
|
||||
Get-CimInstance Win32_Process -Filter "Name = 'weed.exe'" |
|
||||
Where-Object { $_.CommandLine -like '*mount*' } |
|
||||
ForEach-Object { Stop-Process -Id $_.ProcessId -Force }
|
||||
Start-Sleep -Seconds 5
|
||||
Write-Host "::endgroup::"
|
||||
|
||||
Start-Mount 'seaweed-remount2'
|
||||
|
||||
Write-Host "::group::explorer-style walk"
|
||||
New-Item -ItemType Directory -Force -Path S:\walk | Out-Null
|
||||
1..200 | ForEach-Object { Set-Content -Path "S:\walk\f$_.txt" -Value "line $_" }
|
||||
$names = @(Get-ChildItem S:\walk | ForEach-Object { $_.Name })
|
||||
if ($names.Count -ne 200) {
|
||||
# Name the strays: a dot entry surfacing here is a different problem
|
||||
# from a missing or duplicated file.
|
||||
$unexpected = $names | Where-Object { $_ -notmatch '^f\d+\.txt$' }
|
||||
throw "listed $($names.Count) entries, expected 200; unexpected: $($unexpected -join ', ')"
|
||||
}
|
||||
$body = Get-Content S:\walk\f42.txt
|
||||
if ($body -ne 'line 42') { throw "unexpected content: $body" }
|
||||
Copy-Item S:\walk\f42.txt S:\walk\copy.txt
|
||||
Remove-Item S:\walk -Recurse -Force
|
||||
if (Test-Path S:\walk) { throw "directory survived recursive delete" }
|
||||
Write-Host "::endgroup::"
|
||||
|
||||
- name: Logs
|
||||
if: always()
|
||||
shell: pwsh
|
||||
run: |
|
||||
foreach ($f in 'C:\seaweed-mount.log','C:\seaweed-mount.err.log','C:\seaweed-remount.log','C:\seaweed-remount.err.log','C:\seaweed-remount2.log','C:\seaweed-remount2.err.log','C:\seaweed-dirmount.log','C:\seaweed-dirmount.err.log','C:\seaweed-mini.log','C:\seaweed-mini.err.log') {
|
||||
if (Test-Path $f) { Write-Host "===== $f"; Get-Content $f -Tail 200 }
|
||||
}
|
||||
@@ -42,6 +42,12 @@ jobs:
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
# cargo tracks its own inputs but not the runner's C toolchain, so a cached
|
||||
# target/ can carry C objects built against a different glibc than we link against.
|
||||
- name: Fingerprint build toolchain
|
||||
id: toolchain
|
||||
run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache cargo registry and target
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
@@ -49,9 +55,9 @@ jobs:
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
seaweed-volume/target
|
||||
key: rust-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
||||
key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
rust-
|
||||
rust-${{ steps.toolchain.outputs.fingerprint }}-
|
||||
|
||||
- name: Build Rust volume server
|
||||
run: cd seaweed-volume && cargo build --release
|
||||
@@ -79,6 +85,12 @@ jobs:
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
# cargo tracks its own inputs but not the runner's C toolchain, so a cached
|
||||
# target/ can carry C objects built against a different glibc than we link against.
|
||||
- name: Fingerprint build toolchain
|
||||
id: toolchain
|
||||
run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache cargo registry and target
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
@@ -86,9 +98,9 @@ jobs:
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
seaweed-volume/target
|
||||
key: rust-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
||||
key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
rust-
|
||||
rust-${{ steps.toolchain.outputs.fingerprint }}-
|
||||
|
||||
- name: Build Go weed binary
|
||||
run: |
|
||||
@@ -134,6 +146,9 @@ jobs:
|
||||
name: Go Tests with Rust Volume (${{ matrix.test-type }} - Shard ${{ matrix.shard }})
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
# Keep in step with the length of matrix.shard below.
|
||||
SHARD_COUNT: 3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -155,6 +170,12 @@ jobs:
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
# cargo tracks its own inputs but not the runner's C toolchain, so a cached
|
||||
# target/ can carry C objects built against a different glibc than we link against.
|
||||
- name: Fingerprint build toolchain
|
||||
id: toolchain
|
||||
run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache cargo registry and target
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
@@ -162,9 +183,9 @@ jobs:
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
seaweed-volume/target
|
||||
key: rust-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
||||
key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
rust-
|
||||
rust-${{ steps.toolchain.outputs.fingerprint }}-
|
||||
|
||||
- name: Build Go weed binary
|
||||
run: |
|
||||
@@ -176,30 +197,28 @@ jobs:
|
||||
- name: Build Rust volume binary
|
||||
run: cd seaweed-volume && cargo build --release
|
||||
|
||||
# Dealing the listed tests out one by one keeps the shards even. Bucketing
|
||||
# them by first letter did not: names cluster, so ^Test[I-S] drew 50 of
|
||||
# the 114 grpc tests and ran nearly twice as long as the other two shards.
|
||||
- name: Select this shard's tests
|
||||
env:
|
||||
TEST_TYPE: ${{ matrix.test-type }}
|
||||
SHARD: ${{ matrix.shard }}
|
||||
run: |
|
||||
tests=$(go test -tags 5BytesOffset ./test/volume_server/"$TEST_TYPE"/... -list '.*' | grep '^Test' | sort -u)
|
||||
# An empty list would make -run match nothing and the shard pass vacuously.
|
||||
[ -n "$tests" ] || { echo "listed no tests in test/volume_server/$TEST_TYPE"; exit 1; }
|
||||
selected=$(echo "$tests" | awk -v n="$SHARD_COUNT" -v i="$SHARD" 'NR % n == i - 1')
|
||||
echo "shard $SHARD of $SHARD_COUNT runs $(echo "$selected" | wc -l) of $(echo "$tests" | wc -l) tests"
|
||||
echo "TEST_PATTERN=^($(echo "$selected" | paste -sd'|' -))\$" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Run volume server integration tests with Rust volume
|
||||
env:
|
||||
WEED_BINARY: ${{ github.workspace }}/weed/weed
|
||||
RUST_VOLUME_BINARY: ${{ github.workspace }}/seaweed-volume/target/release/weed-volume
|
||||
VOLUME_SERVER_IMPL: rust
|
||||
run: |
|
||||
if [ "${{ matrix.test-type }}" == "grpc" ]; then
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-H]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[I-S]"
|
||||
else
|
||||
TEST_PATTERN="^Test[T-Z]"
|
||||
fi
|
||||
else
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-G]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[H-R]"
|
||||
else
|
||||
TEST_PATTERN="^Test[S-Z]"
|
||||
fi
|
||||
fi
|
||||
echo "Running Go volume server tests with Rust volume for ${{ matrix.test-type }} (Shard ${{ matrix.shard }}, pattern: ${TEST_PATTERN})..."
|
||||
echo "Running Go volume server tests with Rust volume for ${{ matrix.test-type }} (Shard ${{ matrix.shard }} of ${SHARD_COUNT})..."
|
||||
go test -v -count=1 -tags 5BytesOffset -timeout=30m ./test/volume_server/${{ matrix.test-type }}/... -run "${TEST_PATTERN}"
|
||||
|
||||
- name: Collect logs on failure
|
||||
@@ -220,23 +239,6 @@ jobs:
|
||||
- name: Test summary
|
||||
if: always()
|
||||
run: |
|
||||
if [ "${{ matrix.test-type }}" == "grpc" ]; then
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-H]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[I-S]"
|
||||
else
|
||||
TEST_PATTERN="^Test[T-Z]"
|
||||
fi
|
||||
else
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-G]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[H-R]"
|
||||
else
|
||||
TEST_PATTERN="^Test[S-Z]"
|
||||
fi
|
||||
fi
|
||||
echo "## Rust Volume - Go Test Summary (${{ matrix.test-type }} - Shard ${{ matrix.shard }})" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "- Suite: test/volume_server/${{ matrix.test-type }} (Pattern: ${TEST_PATTERN})" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "- Suite: test/volume_server/${{ matrix.test-type }} (shard ${{ matrix.shard }} of ${SHARD_COUNT}, see 'Select this shard's tests' for the split)" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "- Volume server: Rust (VOLUME_SERVER_IMPL=rust)" >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -38,7 +38,22 @@ jobs:
|
||||
working-directory: test/s3/versioning
|
||||
run: |
|
||||
set -x
|
||||
make test-with-server TEST_PATTERN="TestVersioningCompleteMultipartUploadIsIdempotent|TestVersioningSelfCopyMetadataReplaceCreatesNewVersion|TestVersioningSelfCopyMetadataReplaceSuspendedKeepsNullVersion|TestSuspendedDeleteCreatesDeleteMarker"
|
||||
# Run every versioning test, so a regression test lands covered instead
|
||||
# of waiting for someone to remember this file. Name a test in EXCLUDE,
|
||||
# with the reason, to keep it out.
|
||||
#
|
||||
# TestVersioningPagination*: opt-in stress tests that build 1500+
|
||||
# versions. They self-skip without ENABLE_STRESS_TESTS and have their
|
||||
# own make target, so this gate should not carry them.
|
||||
EXCLUDE='TestVersioningPagination.*'
|
||||
tests=$(go test . -list '.*' | grep '^Test' | sort -u)
|
||||
# An empty list would make -run match nothing and pass this job vacuously.
|
||||
[ -n "$tests" ] || { echo "listed no versioning tests"; exit 1; }
|
||||
selected=$(echo "$tests" | grep -vE "^($EXCLUDE)$")
|
||||
[ -n "$selected" ] || { echo "EXCLUDE matched every test"; exit 1; }
|
||||
echo "running $(echo "$selected" | wc -l) of $(echo "$tests" | wc -l) versioning tests"
|
||||
# make swallows a lone trailing $, taking the anchor with it, so escape it.
|
||||
make test-with-server TEST_PATTERN="^($(echo "$selected" | paste -sd'|' -))"'$$'
|
||||
|
||||
- name: Show server logs on failure
|
||||
if: failure()
|
||||
|
||||
@@ -694,10 +694,12 @@ jobs:
|
||||
export WEED_DATA_DIR="/tmp/seaweedfs-copy-test-$(date +%s)"
|
||||
mkdir -p "$WEED_DATA_DIR"
|
||||
set -x
|
||||
# Each test bucket is its own collection and grows 7 volumes; the suite runs
|
||||
# faster than the heartbeat that returns slots from the deleted collections.
|
||||
weed -v 0 server -filer -filer.maxMB=64 -s3 -ip.bind 0.0.0.0 \
|
||||
-dir="$WEED_DATA_DIR" \
|
||||
-master.raftHashicorp -master.electionTimeout 1s -master.volumeSizeLimitMB=100 \
|
||||
-volume.max=100 -volume.preStopSeconds=1 \
|
||||
-volume.max=300 -volume.preStopSeconds=1 \
|
||||
-master.port=9336 -volume.port=8083 -filer.port=8891 -s3.port=8003 -metricsPort=9327 \
|
||||
-s3.allowDeleteBucketNotEmpty=true -s3.config="$GITHUB_WORKSPACE/docker/compose/s3.json" -master.peers=none &
|
||||
pid=$!
|
||||
|
||||
@@ -29,6 +29,8 @@ permissions:
|
||||
|
||||
env:
|
||||
TEST_TIMEOUT: '30m'
|
||||
# Keep in step with the length of matrix.shard below.
|
||||
SHARD_COUNT: 3
|
||||
|
||||
jobs:
|
||||
volume-server-integration-tests:
|
||||
@@ -57,28 +59,26 @@ jobs:
|
||||
chmod +x weed
|
||||
./weed version
|
||||
|
||||
# Dealing the listed tests out one by one keeps the shards even. Bucketing
|
||||
# them by first letter did not: names cluster, so ^Test[I-S] drew 50 of
|
||||
# the 114 grpc tests and ran nearly twice as long as the other two shards.
|
||||
- name: Select this shard's tests
|
||||
env:
|
||||
TEST_TYPE: ${{ matrix.test-type }}
|
||||
SHARD: ${{ matrix.shard }}
|
||||
run: |
|
||||
tests=$(go test ./test/volume_server/"$TEST_TYPE"/... -list '.*' | grep '^Test' | sort -u)
|
||||
# An empty list would make -run match nothing and the shard pass vacuously.
|
||||
[ -n "$tests" ] || { echo "listed no tests in test/volume_server/$TEST_TYPE"; exit 1; }
|
||||
selected=$(echo "$tests" | awk -v n="$SHARD_COUNT" -v i="$SHARD" 'NR % n == i - 1')
|
||||
echo "shard $SHARD of $SHARD_COUNT runs $(echo "$selected" | wc -l) of $(echo "$tests" | wc -l) tests"
|
||||
echo "TEST_PATTERN=^($(echo "$selected" | paste -sd'|' -))\$" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Run volume server integration tests
|
||||
env:
|
||||
WEED_BINARY: ${{ github.workspace }}/weed/weed
|
||||
run: |
|
||||
if [ "${{ matrix.test-type }}" == "grpc" ]; then
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-H]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[I-S]"
|
||||
else
|
||||
TEST_PATTERN="^Test[T-Z]"
|
||||
fi
|
||||
else
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-G]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[H-R]"
|
||||
else
|
||||
TEST_PATTERN="^Test[S-Z]"
|
||||
fi
|
||||
fi
|
||||
echo "Running volume server integration tests for ${{ matrix.test-type }} (Shard ${{ matrix.shard }}, pattern: ${TEST_PATTERN})..."
|
||||
echo "Running volume server integration tests for ${{ matrix.test-type }} (Shard ${{ matrix.shard }} of ${SHARD_COUNT})..."
|
||||
go test -v -count=1 -timeout=${{ env.TEST_TIMEOUT }} ./test/volume_server/${{ matrix.test-type }}/... -run "${TEST_PATTERN}"
|
||||
|
||||
- name: Collect logs on failure
|
||||
@@ -99,23 +99,6 @@ jobs:
|
||||
- name: Test summary
|
||||
if: always()
|
||||
run: |
|
||||
if [ "${{ matrix.test-type }}" == "grpc" ]; then
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-H]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[I-S]"
|
||||
else
|
||||
TEST_PATTERN="^Test[T-Z]"
|
||||
fi
|
||||
else
|
||||
if [ "${{ matrix.shard }}" == "1" ]; then
|
||||
TEST_PATTERN="^Test[A-G]"
|
||||
elif [ "${{ matrix.shard }}" == "2" ]; then
|
||||
TEST_PATTERN="^Test[H-R]"
|
||||
else
|
||||
TEST_PATTERN="^Test[S-Z]"
|
||||
fi
|
||||
fi
|
||||
echo "## Volume Server Integration Test Summary (${{ matrix.test-type }} - Shard ${{ matrix.shard }})" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "- Suite: test/volume_server/${{ matrix.test-type }} (Pattern: ${TEST_PATTERN})" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "- Command: go test -v -count=1 -timeout=${{ env.TEST_TIMEOUT }} ./test/volume_server/${{ matrix.test-type }}/... -run \"${TEST_PATTERN}\"" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "- Suite: test/volume_server/${{ matrix.test-type }} (shard ${{ matrix.shard }} of ${SHARD_COUNT}, see 'Select this shard's tests' for the split)" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "- Command: go test -v -count=1 -timeout=${{ env.TEST_TIMEOUT }} ./test/volume_server/${{ matrix.test-type }}/... -run \"\${TEST_PATTERN}\"" >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -45,12 +45,12 @@ require (
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12
|
||||
github.com/karlseguin/ccache/v2 v2.0.8
|
||||
github.com/klauspost/compress v1.19.0
|
||||
github.com/klauspost/compress v1.19.1
|
||||
github.com/klauspost/reedsolomon v1.14.1
|
||||
github.com/kurin/blazer v0.5.3
|
||||
github.com/linxGnu/grocksdb v1.10.8
|
||||
github.com/mailru/easyjson v0.9.1 // indirect
|
||||
github.com/mattn/go-isatty v0.0.22 // indirect
|
||||
github.com/mailru/easyjson v0.9.2 // indirect
|
||||
github.com/mattn/go-isatty v0.0.23 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/olivere/elastic/v7 v7.0.32
|
||||
@@ -59,9 +59,9 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/posener/complete v1.2.3
|
||||
github.com/pquerna/cachecontrol v0.2.0
|
||||
github.com/prometheus/client_golang v1.24.0
|
||||
github.com/prometheus/client_golang v1.24.1
|
||||
github.com/prometheus/client_model v0.6.2
|
||||
github.com/prometheus/common v0.70.0 // indirect
|
||||
github.com/prometheus/common v0.70.1 // indirect
|
||||
github.com/prometheus/procfs v0.21.1
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
@@ -92,17 +92,17 @@ require (
|
||||
gocloud.dev/pubsub/natspubsub v0.46.0
|
||||
gocloud.dev/pubsub/rabbitpubsub v0.46.0
|
||||
golang.org/x/crypto v0.54.0
|
||||
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f
|
||||
golang.org/x/image v0.43.0
|
||||
golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597
|
||||
golang.org/x/image v0.44.0
|
||||
golang.org/x/net v0.57.0
|
||||
golang.org/x/oauth2 v0.36.0
|
||||
golang.org/x/sys v0.47.0
|
||||
golang.org/x/text v0.40.0 // indirect
|
||||
golang.org/x/tools v0.47.0 // indirect
|
||||
golang.org/x/tools v0.48.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
google.golang.org/api v0.289.0
|
||||
google.golang.org/genproto v0.0.0-20260519071638-aa98bba5eb94 // indirect
|
||||
google.golang.org/grpc v1.82.1
|
||||
google.golang.org/grpc v1.84.0-dev.0.20260723093437-b6eac429d7b6
|
||||
google.golang.org/protobuf v1.36.11
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
modernc.org/b v1.0.0 // indirect
|
||||
@@ -123,10 +123,10 @@ require (
|
||||
github.com/apple/foundationdb/bindings/go v0.0.0-20250911184653-27f7192f47c3
|
||||
github.com/arangodb/go-driver v1.6.9
|
||||
github.com/armon/go-metrics v0.4.1
|
||||
github.com/aws/aws-sdk-go-v2 v1.43.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.32.25
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.30
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.102.2
|
||||
github.com/aws/aws-sdk-go-v2 v1.43.2
|
||||
github.com/aws/aws-sdk-go-v2/config v1.32.33
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.32
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.105.2
|
||||
github.com/cognusion/imaging v1.0.4
|
||||
github.com/fluent/fluent-logger-golang v1.10.1
|
||||
github.com/getsentry/sentry-go v0.44.1
|
||||
@@ -144,11 +144,11 @@ require (
|
||||
github.com/parquet-go/parquet-go v0.30.1
|
||||
github.com/pkg/sftp v1.13.11
|
||||
github.com/rabbitmq/amqp091-go v1.11.0
|
||||
github.com/rclone/rclone v1.74.3
|
||||
github.com/rclone/rclone v1.75.0
|
||||
github.com/rdleal/intervalst v1.5.0
|
||||
github.com/redis/go-redis/v9 v9.21.0
|
||||
github.com/schollz/progressbar/v3 v3.19.1
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.3
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.4
|
||||
github.com/shirou/gopsutil/v4 v4.26.6
|
||||
github.com/tarantool/go-option v1.1.0
|
||||
github.com/tarantool/go-tarantool/v3 v3.0.0
|
||||
@@ -156,7 +156,7 @@ require (
|
||||
github.com/tikv/client-go/v2 v2.0.7
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.2
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.144.5
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.146.3
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.12
|
||||
go.uber.org/atomic v1.11.0
|
||||
golang.org/x/sync v0.22.0
|
||||
@@ -176,19 +176,20 @@ require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
|
||||
github.com/FilenCloudDienste/filen-sdk-go v0.0.39 // indirect
|
||||
github.com/ProtonMail/gopenpgp/v3 v3.4.1 // indirect
|
||||
github.com/a1ex3/zstd-seekable-format-go/pkg v0.10.0 // indirect
|
||||
github.com/adrg/xdg v0.5.3 // indirect
|
||||
github.com/anchore/go-lzo v0.1.0 // indirect
|
||||
github.com/anchore/go-lzo v0.1.1 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||
github.com/apache/arrow-go/v18 v18.6.0 // indirect
|
||||
github.com/apache/thrift v0.23.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.5.0 // indirect
|
||||
github.com/apache/arrow-go/v18 v18.7.0 // indirect
|
||||
github.com/apache/thrift v0.24.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.5.2 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/bazelbuild/rules_go v0.46.0 // indirect
|
||||
github.com/biogo/store v0.0.0-20201120204734-aad293a2328f // indirect
|
||||
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
||||
github.com/boombuler/barcode v1.1.0 // indirect
|
||||
github.com/buger/jsonparser v1.1.2 // indirect
|
||||
github.com/buger/jsonparser v1.2.0 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
||||
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
|
||||
@@ -203,7 +204,7 @@ require (
|
||||
github.com/containerd/platforms v1.0.0-rc.4 // indirect
|
||||
github.com/cpuguy83/dockercfg v0.3.2 // indirect
|
||||
github.com/dave/dst v0.27.2 // indirect
|
||||
github.com/diskfs/go-diskfs v1.7.0 // indirect
|
||||
github.com/diskfs/go-diskfs v1.9.4 // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/go-connections v0.6.0 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
@@ -222,7 +223,7 @@ require (
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.7 // indirect
|
||||
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260331173834-036f908d0160 // indirect
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260708165336-dd6561bacfa2 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
@@ -234,6 +235,7 @@ require (
|
||||
github.com/lib/pq v1.12.0 // indirect
|
||||
github.com/lithammer/fuzzysearch v1.1.8 // indirect
|
||||
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
|
||||
github.com/lpar/calendar v0.2.0 // indirect
|
||||
github.com/magiconair/properties v1.8.10 // indirect
|
||||
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||
github.com/moby/go-archive v0.2.0 // indirect
|
||||
@@ -244,6 +246,7 @@ require (
|
||||
github.com/moby/sys/user v0.4.0 // indirect
|
||||
github.com/moby/sys/userns v0.1.0 // indirect
|
||||
github.com/moby/term v0.5.2 // indirect
|
||||
github.com/oklog/ulid/v2 v2.1.1 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.1 // indirect
|
||||
github.com/openzipkin/zipkin-go v0.4.3 // indirect
|
||||
@@ -254,15 +257,16 @@ require (
|
||||
github.com/pquerna/otp v1.5.0 // indirect
|
||||
github.com/pterm/pterm v0.12.83 // indirect
|
||||
github.com/quic-go/qpack v0.6.0 // indirect
|
||||
github.com/rclone/Proton-API-Bridge v1.0.3 // indirect
|
||||
github.com/rclone/go-proton-api v1.0.2 // indirect
|
||||
github.com/rogpeppe/go-internal v1.14.1 // indirect
|
||||
github.com/rclone/Proton-API-Bridge v1.0.4 // indirect
|
||||
github.com/rclone/go-proton-api v1.0.3 // indirect
|
||||
github.com/rogpeppe/go-internal v1.15.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||
github.com/smarty/assertions v1.15.0 // indirect
|
||||
github.com/sony/gobreaker/v2 v2.4.0 // indirect
|
||||
github.com/stretchr/objx v0.5.3 // indirect
|
||||
github.com/substrait-io/substrait v0.87.0 // indirect
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.0 // indirect
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.1 // indirect
|
||||
github.com/substrait-io/substrait-protobuf/go v0.85.0 // indirect
|
||||
github.com/twmb/avro v1.7.2 // indirect
|
||||
github.com/twpayne/go-geom v1.6.1 // indirect
|
||||
@@ -281,12 +285,12 @@ require (
|
||||
go.uber.org/mock v0.5.2 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.4 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||
golang.org/x/mod v0.37.0 // indirect
|
||||
golang.org/x/mod v0.38.0 // indirect
|
||||
gonum.org/v1/gonum v0.17.0 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
cel.dev/expr v0.25.1 // indirect
|
||||
cel.dev/expr v0.25.2 // indirect
|
||||
cloud.google.com/go/auth v0.20.0 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.9.0 // indirect
|
||||
@@ -297,53 +301,50 @@ require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.5.4 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.7.0 // indirect
|
||||
github.com/Azure/go-ntlmssp v0.1.1 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 // indirect
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.82 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 // indirect
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.194 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.57.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.57.0 // indirect
|
||||
github.com/IBM/go-sdk-core/v5 v5.21.2 // indirect
|
||||
github.com/IBM/go-sdk-core/v5 v5.23.1 // indirect
|
||||
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd // indirect
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e // indirect
|
||||
github.com/ProtonMail/go-crypto v1.4.1 // indirect
|
||||
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
|
||||
github.com/ProtonMail/go-srp v0.0.7 // indirect
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.9.0 // indirect
|
||||
github.com/PuerkitoBio/goquery v1.11.0 // indirect
|
||||
github.com/PuerkitoBio/goquery v1.12.0 // indirect
|
||||
github.com/abbot/go-http-auth v0.4.0 // indirect
|
||||
github.com/andybalholm/brotli v1.2.1 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.3 // indirect
|
||||
github.com/andybalholm/brotli v1.2.2 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.4 // indirect
|
||||
github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc // indirect
|
||||
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.31 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.31 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.31 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.32 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.18 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.31 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.25 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.14 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.34 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.34 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.14 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.39.14 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.24 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.33.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.45.0
|
||||
github.com/aws/smithy-go v1.27.3
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.33.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.45.2
|
||||
github.com/aws/smithy-go v1.27.5
|
||||
github.com/boltdb/bolt v1.3.1 // indirect
|
||||
github.com/bradenaw/juniper v0.15.3 // indirect
|
||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
|
||||
github.com/buengese/sgzip v0.1.1 // indirect
|
||||
github.com/calebcase/tmpfile v1.0.3 // indirect
|
||||
github.com/chilts/sid v0.0.0-20190607042430-660e94789ec9 // indirect
|
||||
github.com/cloudflare/circl v1.6.3 // indirect
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.15.0 // indirect
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20250228001242-d4c70e6251cc // indirect
|
||||
github.com/cloudflare/circl v1.6.4 // indirect
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.16.0 // indirect
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20260701064823-d8c5600d73b8 // indirect
|
||||
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc // indirect
|
||||
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
|
||||
github.com/colinmarc/hdfs/v2 v2.4.0 // indirect
|
||||
@@ -352,29 +353,29 @@ require (
|
||||
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
||||
github.com/d4l3k/messagediff v1.2.1 // indirect
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5 // indirect
|
||||
github.com/ebitengine/purego v0.10.0 // indirect
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.4.0 // indirect
|
||||
github.com/ebitengine/purego v0.10.1 // indirect
|
||||
github.com/elastic/gosigar v0.14.3 // indirect
|
||||
github.com/emersion/go-message v0.18.2 // indirect
|
||||
github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff // indirect
|
||||
github.com/emersion/go-vcard v0.0.0-20260618161152-d854b7e0e2d3 // indirect
|
||||
github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect
|
||||
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/felixge/httpsnoop v1.1.0 // indirect
|
||||
github.com/flynn/noise v1.1.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
|
||||
github.com/geoffgarside/ber v1.2.0 // indirect
|
||||
github.com/go-chi/chi/v5 v5.2.5 // indirect
|
||||
github.com/go-chi/chi/v5 v5.3.1 // indirect
|
||||
github.com/go-darwin/apfs v0.0.0-20211011131704-f84b94dbf348 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||
github.com/go-openapi/errors v0.22.6 // indirect
|
||||
github.com/go-openapi/strfmt v0.25.0 // indirect
|
||||
github.com/go-openapi/errors v0.22.8 // indirect
|
||||
github.com/go-openapi/strfmt v0.27.0 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.30.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.30.3 // indirect
|
||||
github.com/go-resty/resty/v2 v2.17.2 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
|
||||
github.com/goccy/go-json v0.10.6 // indirect
|
||||
@@ -405,17 +406,16 @@ require (
|
||||
github.com/jtolio/noiseconn v0.0.0-20231127013910-f6d9ecbf1de7 // indirect
|
||||
github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 // indirect
|
||||
github.com/k0kubun/pp v3.0.1+incompatible
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
|
||||
github.com/koofr/go-httpclient v0.0.0-20240520111329-e20f8f203988 // indirect
|
||||
github.com/koofr/go-koofrclient v0.0.0-20221207135200-cbd7fc9ad6a6 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/lanrat/extsort v1.4.2 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/lpar/date v1.0.0 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20260216142805-b3301c5f2a88 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.22 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20260627054121-477a66015f15 // indirect
|
||||
github.com/mattn/go-colorable v0.1.15 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.24 // indirect
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
|
||||
@@ -430,8 +430,8 @@ require (
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.23.3 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/oracle/oci-go-sdk/v65 v65.111.0 // indirect
|
||||
github.com/panjf2000/ants/v2 v2.11.5 // indirect
|
||||
github.com/oracle/oci-go-sdk/v65 v65.121.0 // indirect
|
||||
github.com/panjf2000/ants/v2 v2.12.1 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 // indirect
|
||||
@@ -451,26 +451,27 @@ require (
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
|
||||
github.com/sagikazarmark/locafero v0.11.0 // indirect
|
||||
github.com/samber/lo v1.52.0 // indirect
|
||||
github.com/samber/lo v1.53.0 // indirect
|
||||
github.com/seaweedfs/cockroachdb-parser v0.0.0-20260225204133-2f342c5ea564
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
|
||||
github.com/sony/gobreaker v1.0.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
|
||||
github.com/spacemonkeygo/monkit/v3 v3.0.25-0.20251022131615-eb24eb109368 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
|
||||
github.com/spiffe/go-spiffe/v2 v2.8.1 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20251120131202-6845944c051c // indirect
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20260717075258-c6acd6a5bd04 // indirect
|
||||
github.com/tarantool/go-iproto v1.1.0 // indirect
|
||||
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
|
||||
github.com/tikv/pd/client v0.0.0-20230329114254-1948c247c2b1 // indirect
|
||||
github.com/tinylib/msgp v1.6.3 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.16 // indirect
|
||||
github.com/tklauser/numcpus v0.11.0 // indirect
|
||||
github.com/tinylib/msgp v1.6.4 // indirect
|
||||
github.com/tklauser/go-sysconf v0.4.0 // indirect
|
||||
github.com/tklauser/numcpus v0.12.0 // indirect
|
||||
github.com/twmb/murmur3 v1.1.8 // indirect
|
||||
github.com/unknwon/goconfig v1.0.0 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
github.com/winfsp/cgofuse v1.6.1-0.20260126094232-f2c4fccdb286
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e // indirect
|
||||
github.com/ydb-platform/ydb-go-genproto v0.0.0-20260428144813-1c07baab7f7b // indirect
|
||||
@@ -480,12 +481,12 @@ require (
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||
github.com/zeebo/errs v1.4.0 // indirect
|
||||
go.etcd.io/bbolt v1.4.3 // indirect
|
||||
go.etcd.io/bbolt v1.5.0 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.6.12 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.43.0 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
|
||||
go.opentelemetry.io/otel v1.44.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.44.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
|
||||
@@ -495,8 +496,8 @@ require (
|
||||
go.uber.org/zap v1.27.1 // indirect
|
||||
golang.org/x/term v0.45.0
|
||||
golang.org/x/time v0.15.0
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20260706201446-f0a921348800 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260715232425-e75dac1f907d // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||
gopkg.in/validator.v2 v2.0.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
@@ -504,12 +505,12 @@ require (
|
||||
modernc.org/libc v1.73.4 // indirect
|
||||
moul.io/http2curl/v2 v2.3.0 // indirect
|
||||
sigs.k8s.io/yaml v1.6.0 // indirect
|
||||
storj.io/common v0.0.0-20260225132117-99155641c30a // indirect
|
||||
storj.io/drpc v0.0.35-0.20250513201419-f7819ea69b55 // indirect
|
||||
storj.io/eventkit v0.0.0-20250410172343-61f26d3de156 // indirect
|
||||
storj.io/common v0.0.0-20260629224719-ba1bff0a7846 // indirect
|
||||
storj.io/drpc v1.0.0 // indirect
|
||||
storj.io/eventkit v0.0.0-20260716074419-6861a92e2aa5 // indirect
|
||||
storj.io/infectious v0.0.2 // indirect
|
||||
storj.io/picobuf v0.0.4 // indirect
|
||||
storj.io/uplink v1.14.0 // indirect
|
||||
storj.io/uplink v1.14.3 // indirect
|
||||
)
|
||||
|
||||
// replace github.com/seaweedfs/raft => /Users/chrislu/go/src/github.com/seaweedfs/raft
|
||||
|
||||
@@ -6,8 +6,8 @@ atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8=
|
||||
atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ=
|
||||
atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs=
|
||||
atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU=
|
||||
cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4=
|
||||
cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
|
||||
cel.dev/expr v0.25.2 h1:K6j46C81hXtZQfuX60cVWQFBJahKSE2gfRbNuvr5bFs=
|
||||
cel.dev/expr v0.25.2/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
@@ -569,8 +569,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1/go.mod h1:Ng3urmn6dYe8gnbCMoHHVl5APYz2txho3koEkV2o2HA=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.0 h1:irsmOWwkp0KCTTNS5e2hdFeIvSQClQo2No3IaNmL3Vw=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.0/go.mod h1:GWcBkQj3MqN7ozHKLaCCAuNLiXoIGv2RtanfAwSjY/Y=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.5.4 h1:tZh20RjgfMxKBxJiIS75iTVAKIUxrST5X2dVHMTptL4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.5.4/go.mod h1:vGYAk36rhMVCfTP7v+RVruCR0zmPe6S+36KRpDCLySw=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.7.0 h1:cuiKf1UVyWHu+XSQghPZR/qEF43JIcuk2CDqMlPiT6M=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.7.0/go.mod h1:9JSyvgXLPAOC4jfhgZg58XeU2FJHsGmxuYSclCFQ4ZY=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
|
||||
github.com/Azure/go-ntlmssp v0.1.1 h1:l+FM/EEMb0U9QZE7mKNEDw5Mu3mFiaa2GKOoTSsNDPw=
|
||||
@@ -591,18 +591,18 @@ github.com/DefangLabs/secret-detector v0.0.0-20250403165618-22662109213e h1:rd4b
|
||||
github.com/DefangLabs/secret-detector v0.0.0-20250403165618-22662109213e/go.mod h1:blbwPQh4DTlCZEfk1BLU4oMIhLda2U+A840Uag9DsZw=
|
||||
github.com/FilenCloudDienste/filen-sdk-go v0.0.39 h1:tgV5jYL6dsXop9TpDTIQU6UwJjws122HrwskaEE/igY=
|
||||
github.com/FilenCloudDienste/filen-sdk-go v0.0.39/go.mod h1:0cBhKXQg49XbKZZfk5TCDa3sVLP+xMxZTWL+7KY0XR0=
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.82 h1:2RfP0d2QgkFH64BjZSWd59aMsc28IyWsUuHqU0txBtY=
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.82/go.mod h1:IPk80dOmc7VFC0DJ85xMTPmre+8xoXX6kGHAkf5jRRw=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 h1:rIkQfkCOVKc1OiRCNcSDD8ml5RJlZbH/Xsq7lbpynwc=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0/go.mod h1:RD2SsorTmYhF6HkTmDw7KmPYQk8OBYwTkuasChwv7R4=
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.194 h1:dtOFxSTWWRpkmvXa6ycNiw8dVDu1wkgzcXyVV1VafNc=
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.194/go.mod h1:rl0WumSN9gSo775DgvQv+wMQ8rlb0ES/1hU5jkMtLXg=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0 h1:yzIYdwuro811Z27D3T80Wkd3rqZzb0K43nner7Eh1yE=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0/go.mod h1:pJTkW8hEUIIi3Pf65lPZOnn4Y81yCllX6IWk2jNXdkM=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.57.0 h1:jLdiS1vO+XJFyDSWRHBx56r4s/NNtcl5J6KyCcWUX/w=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.57.0/go.mod h1:8lmpHY+1VRoteiOwyrQMDt1YGXOrFKCz+1wJW7n3ODY=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.57.0 h1:cSjUzZ7KU8hicTgzaSv9NmSyM9fTVK3y5lsBUl3wOis=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.57.0/go.mod h1:dzcEjy1WJ0Q4u9twNR3LcLhNoYMRCrMCMafpxa0TjPQ=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.57.0 h1:RoO5+d7uCmDqovLrHCr2/BuViUXvdcrNxyNM1pN9dDQ=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.57.0/go.mod h1:YqwkQPrWSC7+byyc1VlKbWLBF5JsW5IoL6xUkemYSXk=
|
||||
github.com/IBM/go-sdk-core/v5 v5.21.2 h1:mJ5QbLPOm4g5qhZiVB6wbSllfpeUExftGoyPek2hk4M=
|
||||
github.com/IBM/go-sdk-core/v5 v5.21.2/go.mod h1:ngpMgwkjur1VNUjqn11LPk3o5eCyOCRbcfg/0YAY7Hc=
|
||||
github.com/IBM/go-sdk-core/v5 v5.23.1 h1:fxLusCG+GlGY1SM7BYAAiiSFhzKUs5zqs0P8knDqeFU=
|
||||
github.com/IBM/go-sdk-core/v5 v5.23.1/go.mod h1:yO+OQpByKDLTvpEcsFFexgzpeR8eRfCFWAYzxkAu4bk=
|
||||
github.com/Jille/raft-grpc-transport v1.6.1 h1:gN3sjapb+fVbiebS7AfQQgbV2ecTOI7ur7NPPC7Mhoc=
|
||||
github.com/Jille/raft-grpc-transport v1.6.1/go.mod h1:HbOjEdu/yzCJ/mjTF6wEOJNbAUpHfU2UOA2hVD4CNFg=
|
||||
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
|
||||
@@ -631,14 +631,12 @@ github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e/go.mod h1:Og5/
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230321155629-9a39f2531310/go.mod h1:8TI4H3IbrackdNgv+92dI+rhpCaLqM0IfpgCgenFvRE=
|
||||
github.com/ProtonMail/go-crypto v1.4.1 h1:9RfcZHqEQUvP8RzecWEUafnZVtEvrBVL9BiF67IQOfM=
|
||||
github.com/ProtonMail/go-crypto v1.4.1/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo=
|
||||
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ekTTXpdwKYF8eBlsYsDVoggDAuAjoK66k=
|
||||
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw=
|
||||
github.com/ProtonMail/go-srp v0.0.7 h1:Sos3Qk+th4tQR64vsxGIxYpN3rdnG9Wf9K4ZloC1JrI=
|
||||
github.com/ProtonMail/go-srp v0.0.7/go.mod h1:giCp+7qRnMIcCvI6V6U3S1lDDXDQYx2ewJ6F/9wdlJk=
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.9.0 h1:ruLzBmwe4dR1hdnrsEJ/S7psSBmV15gFttFUPP/+/kE=
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.9.0/go.mod h1:IldDyh9Hv1ZCCYatTuuEt1XZJ0OPjxLpTarDfglih7s=
|
||||
github.com/PuerkitoBio/goquery v1.11.0 h1:jZ7pwMQXIITcUXNH83LLk+txlaEy6NVOfTuP43xxfqw=
|
||||
github.com/PuerkitoBio/goquery v1.11.0/go.mod h1:wQHgxUOU3JGuj3oD/QFfxUdlzW6xPHfqyHre6VMY4DQ=
|
||||
github.com/ProtonMail/gopenpgp/v3 v3.4.1 h1:K7uUhSHSJxORZ+RuHpilTT6S4MA2whCRlXNwLqd0+ys=
|
||||
github.com/ProtonMail/gopenpgp/v3 v3.4.1/go.mod h1:bGdV9f6edhmd581wzXsQCTKdH8bXBbyhkgDKPjwPc6U=
|
||||
github.com/PuerkitoBio/goquery v1.12.0 h1:pAcL4g3WRXekcB9AU/y1mbKez2dbY2AajVhtkO8RIBo=
|
||||
github.com/PuerkitoBio/goquery v1.12.0/go.mod h1:802ej+gV2y7bbIhOIoPY5sT183ZW0YFofScC4q/hIpQ=
|
||||
github.com/Sereal/Sereal/Go/sereal v0.0.0-20231009093132-b9187f1a92c6/go.mod h1:JwrycNnC8+sZPDyzM3MQ86LvaGzSpfxg885KOOwFRW4=
|
||||
github.com/Shopify/sarama v1.38.1 h1:lqqPUPQZ7zPqYlWpTh+LQ9bhYNu2xJL6k1SJN4WVe2A=
|
||||
github.com/Shopify/sarama v1.38.1/go.mod h1:iwv9a67Ha8VNa+TifujYoWGxWnu2kNVAQdSdZ4X2o5g=
|
||||
@@ -675,20 +673,20 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/alexbrainman/sspi v0.0.0-20250919150558-7d374ff0d59e h1:4dAU9FXIyQktpoUAgOJK3OTFc/xug0PCXYCqU0FgDKI=
|
||||
github.com/alexbrainman/sspi v0.0.0-20250919150558-7d374ff0d59e/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
|
||||
github.com/anchore/go-lzo v0.1.0 h1:NgAacnzqPeGH49Ky19QKLBZEuFRqtTG9cdaucc3Vncs=
|
||||
github.com/anchore/go-lzo v0.1.0/go.mod h1:3kLx0bve2oN1iDwgM1U5zGku1Tfbdb0No5qp1eL1fIk=
|
||||
github.com/anchore/go-lzo v0.1.1 h1:IwL/fvkdtlIrYIXck6WxZ3nb8WjjHziYYmGxlooyOnM=
|
||||
github.com/anchore/go-lzo v0.1.1/go.mod h1:3kLx0bve2oN1iDwgM1U5zGku1Tfbdb0No5qp1eL1fIk=
|
||||
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/andybalholm/brotli v1.2.1 h1:R+f5xP285VArJDRgowrfb9DqL18yVK0gKAW/F+eTWro=
|
||||
github.com/andybalholm/brotli v1.2.1/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=
|
||||
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
|
||||
github.com/andybalholm/brotli v1.2.2 h1:HzTuoo2ErYQqf5qvcJInB8uvqSVxRttzkFexPWtnceM=
|
||||
github.com/andybalholm/brotli v1.2.2/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/andybalholm/cascadia v1.3.4 h1:vM2lgh0Vru9Vwyfm4cQqWP2HHMW0u0+2PAW7Q38Qufg=
|
||||
github.com/andybalholm/cascadia v1.3.4/go.mod h1:BLRmbRjpEtNKieZOCCvYj4RqN+KRA41GBe/5O+G93kM=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/antithesishq/antithesis-sdk-go v0.6.0-default-no-op h1:kpBdlEPbRvff0mDD1gk7o9BhI16b9p5yYAXRlidpqJE=
|
||||
github.com/antithesishq/antithesis-sdk-go v0.6.0-default-no-op/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
|
||||
github.com/apache/arrow-go/v18 v18.6.0 h1:GX/Jyd3R7mCLiECAwY9FWbbaYblie2WXBSz4Sw8fNpM=
|
||||
github.com/apache/arrow-go/v18 v18.6.0/go.mod h1:gm3MiPpY82fLYK5VKPB3WoJbsiLVDfT7flD5/vHReKw=
|
||||
github.com/apache/arrow-go/v18 v18.7.0 h1:Vw/i+cJyebUofT7JlqFpe65LrmwxULn166jjwStM4HY=
|
||||
github.com/apache/arrow-go/v18 v18.7.0/go.mod h1:PM6IigLJkdMwIpeHXnymo+xZ52f42a9EYiLtRel4p/A=
|
||||
github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0=
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2 h1:lu/p0Db2av18enHJvWJQoChLssI0P+AR06STq4VdvCc=
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2/go.mod h1:QH/asJjB3mHvY6Dot6ZKMMpTcOrWJ8i9GhsvG1g0PK4=
|
||||
@@ -709,50 +707,50 @@ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+
|
||||
github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk=
|
||||
github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=
|
||||
github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=
|
||||
github.com/aws/aws-sdk-go-v2 v1.43.0 h1:fharf/WhbRAVZ1du0QL7roNFxZ6T/sWr+4Ni617bwSI=
|
||||
github.com/aws/aws-sdk-go-v2 v1.43.0/go.mod h1:5pKeft2eJj+gElQ38Jqg4ibCqh+/AK33/0X3hip7IjM=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.11 h1:h5+3VT69KUBK24grGuuA5saDJTj2IIjLb9au668Fo5I=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.11/go.mod h1:dnakxebH6UwFvcvujL0LVggYQ8nEvBGjU4G/V79Nv94=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.32.25 h1:ACCejvStYoilgwrfegSt5ZntCbPrk52qfwyNcnl3omM=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.32.25/go.mod h1:LJyU8sDRbXUxFn8xMJIGP+v9QYYwveNLI8a/giAOiAs=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.30 h1:TTCvvzFU6gXa4iJecNG/0F/B0oYTiazoRECr2XyLHrY=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.30/go.mod h1:jKxAp2AEncnliinzpgOSZDFv6+VjvWhjw/AtbfsWT9U=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.31 h1:kfVL5wAunCJycL6MOQ6aNh6PlAYEymflcjuKmrWUA0o=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.31/go.mod h1:nWfRNDAppujCQgOUd43lKT4yeLv9z3nJ3bw1G3BgQKo=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.13 h1:uMC4oL6G3MNhodo358QEqSDjrgvzV3TUQ58nyQSGq2E=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.13/go.mod h1:Cer86AE2686DvVUe57LPve3jUBmbujuaonSX8pNzGgw=
|
||||
github.com/aws/aws-sdk-go-v2 v1.43.2 h1:cl+IXwWb3qazClUcm08tGSsB6OiuV83JVJO9B0jQcPc=
|
||||
github.com/aws/aws-sdk-go-v2 v1.43.2/go.mod h1:WEzLKBh/mEjXvx1FtQMWgSxMSTVqxQzjkRtk5fa3wkg=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.14 h1:3IZY0XAJquT3aHzbkHfPzy4ACPcEjVG0x87KOwtpqGY=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.14/go.mod h1:zwM6veDkhGgQFqkBy+uT28AAYpLu+uFMlPl+rCg/73E=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.32.33 h1:M1m/Q6f0OKDEDGwhiNOqx1OjTdrewe3v+GDbHmKczWk=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.32.33/go.mod h1:fGj1iQj2QpIZzp7jE4aQQ+71TE8cd4z9K4+xCd6EqmE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.32 h1:eNE0JnIblBo1NCvd3tqEYuZz9XDefn69R74CHd3nT7U=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.19.32/go.mod h1:yYJu+6tqKUYZuJSYcpSGjz/6sV/SUaAaKIufnWKx2OU=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.33 h1:MobhiR6KIerWxmO74Zit5I3379+mSc2DOdZ3DeRFB9w=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.33/go.mod h1:xu02847OdZfNr/jAfZpHtyRk0b3v4d0kaoxNHxZGG/w=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.34 h1:Pn7OsMwBLbkZ6OnCxWHAjf0L/22H8cnhxZC0uPwtMtg=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.34/go.mod h1:eToXR/Gk1uqpn04eSmdgVXwfS0WvH8aG4eBFr8ygbpU=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.2.3 h1:w5OoDiMN6x53ROmiIImGzmVcxXv2q1GXY+aKV4WAJYM=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.2.3/go.mod h1:dAhgYp776bX3LuWvnSCFwQEjNs6fuFg7YXIy5PXcP3Q=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.31 h1:Z8F3hfCY33IGpJjFAnv0wvtv1FIKj1GHmRDEYqy64tw=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.31/go.mod h1:aVyUoytEyOViR6jhq6jula0xkc5NfBE2hgeF6BvOrao=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.31 h1:hyOxUyXdh3AyjE93gBgsfziJag9ACwcs+ZpDBLzi8mw=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.31/go.mod h1:OERqI9k0draSLB8O8woxY3q25ZWTELRK4RRoLMuMZFo=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.32 h1:0MrUL35H/Y4kdFfItoR5jCgtDQ4Z/8LudAoIHRfA4hE=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.32/go.mod h1:2tNZkuWz54arj8mHVf+8Y7cKkcD8Wr/fBpENgEXpjLc=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13 h1:mbRIur/BiHK6SKPjoBIXSE/hJ6g6JGRLuxQy1jGjlN4=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13/go.mod h1:ITg9em2KbJx1s0y4aqRX5OYWG6HBZ5TVR//OdpEZ2CQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.18 h1:W/EyPFl9A5rXrtoilfwHYEvzHER+K4SpBPtMXi24Mos=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.18/go.mod h1:UG50K+pvd/uy6xExbobg0rjqFBFZe6I3l75EPDZw4tg=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.31 h1:w2SIhW92DZPFrSL4ksVCr8IYff5OZwIcxg8+95tzvAI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.31/go.mod h1:wAhpCQbkov+IcvjozJbd2xRCoZybUEHNkcFunssNACg=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.25 h1:2pQEbwf+/6EDbiit/GcBE2K4IUpMZymaA0kOz3xK978=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.25/go.mod h1:KvT6NCcQ0EZ+ZkVRrlBMt04Po3ok23YELEp7WimhLhM=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.102.2 h1:ie4ElCmUKS26pzrZcIk/lmt4yWjAqLLcawstyQCh298=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.102.2/go.mod h1:zjsomFeX5duj+4PlMB+o4JoWTIx+G0XMyzjYrUbQkN0=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.5.0 h1:OHH5iTQvVGmfHjX/5Q+vFuA/Rf2x6/95aJ/75QCQSm4=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.5.0/go.mod h1:mCF3AK9PpL49oOrhniUXWAfhVBVQ/XbytoE5eccZUIs=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.33 h1:HAp1wLFZzch054uh3FK7rcVYg4v7J2FxVf3h3IGNZas=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.33/go.mod h1:mJk5fmqnF+WUlMdPG37pR2Fh3oh6r8F6ZGUgPKvzu0c=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.33 h1:0YA0aCKgsJyno6xkFfaIgjE3/wK08+Qxo9nQfe1UrWM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.33/go.mod h1:UZqj4WIdTH+ga8Y/DgpAuy/8cGjM3h7gDCliJYGg2SE=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.34 h1:HQYnjFnXpX8EbPW5M1QT8mXzesRPwly0HEPTcFlS02Y=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.34/go.mod h1:tGzj56niKYZBbDIRhwPGDqrULzmWv5b6uBQGqyNaFZw=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.14 h1:SA43nfaY7+1jjMNIc2ywu99JLJLButtIdLP6j+bT870=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.14/go.mod h1:Du3llKcwbQvHsTXSLzTOGQz0DTDBMEzdg7DAGu7inrY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23 h1:9Fjh6fi/U5JEStVZijmaMpUwE/gvBJj7x2B/PjbO9To=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23/go.mod h1:iMoT2f1tClxrWAAnKCXjZQ6LOmfLrMG14wmnWpM+F14=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.33 h1:mqI7OrxN/DUH85F5OqVn3cIfuZ3+HVcebUm2N8mLlgQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.33/go.mod h1:eZ5jdEpvaaOU8nWWE4cTAJETSEA5FZoWxvNRao4piHY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31 h1:uao4A3QZ5UmB326V6KF+qRpv9Tjz7IlnlnTbbANntlU=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31/go.mod h1:I/1+z0VwL1GhQyLgkoHDlygpUZ+iTAwOQ/NsftiUL2I=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.105.2 h1:5C00eQYpTrgQXnp6V3P6P7zPElna3AXvlukbANE6nJI=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.105.2/go.mod h1:zdmCoFO/dSI7GlrwsPqFJI+WlFnSU4Tc8TJnlXrM1Do=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.5.2 h1:EjI1CZzDcBxPkTa3j1BdtIrUDbqnOGssFMeyUS+6W0I=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.5.2/go.mod h1:vN3eb5H8MEAZ4dx0F5Wc9LT8eb3eW7bZZ5BjGJdbw9k=
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.39.14 h1:p8WdWDh5AwSZdp19Haa3XMyPCICi9Z375a/Nu3IIEZY=
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.39.14/go.mod h1:NKVY7DER6VXHkt2I/ycmHakALNboi3Rqwt4eEf/1Cnk=
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.24 h1:JP2wjWGmUp8lTCZb13Dv0Eciyc1jbO8pd0HZVMHFlrc=
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.24/go.mod h1:Ql9ziDutk8ERAN9HMaYANCW3lop451ppebkxEJMLCTM=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.33.0 h1:CaJyYhxBE0M/HJX/YvSaSmQlsI91VHB0lKU8LtLxL3A=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.33.0/go.mod h1:+e6BMRMPjBQoCw/WovYR9GLy2IU0z4Q77smOB1DraSg=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.0 h1:tC323YV77QdafeBr6LUhLDTsboyuyHLNRwAyCP44kGU=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.0/go.mod h1:SfLK1sgviHmbI+MozR9iDwDjL4cdCVZtahsjoR+z7wg=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.45.0 h1:Pd6PNlp4t8PTXxqzstICl52Wsy78vpjFZ7PRUj44mJc=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.45.0/go.mod h1:rmQ0TnHzuLPmabgjPcsywhsSOmaBDgzR4zvDxSPsGdg=
|
||||
github.com/aws/smithy-go v1.27.3 h1:F3Zb497UhhskkfpJmfkXswyo+t0sh9OTBnIHjogWbVY=
|
||||
github.com/aws/smithy-go v1.27.3/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.33.2 h1:zMP1FDFE08L7sM5f1QqkH/ZgKKg8Uc0Dz7KhSSYqWkw=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.33.2/go.mod h1:0LoIZSUKjdo2BleHfT1hv/jlD33LQS00IrBlzoUsoUQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.2 h1:9eTqUYl+SyVmaRPMyBXSO9wwqC6TRwZB82pKENK2hdQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.2/go.mod h1:DThweuz22kiLc7lGHop5vQ9c3bx5W6Azs/YqSHa2fu8=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.45.2 h1:EJd8vZO3E8SE6nmPqxuxlQ1NeSb8as50sf6eGdV4Saw=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.45.2/go.mod h1:OgpPvKzsO2Ranjpli/20djMkg6UrV5mw4W3pZpq1Mqo=
|
||||
github.com/aws/smithy-go v1.27.5 h1:d1ro7KpYOYwP6m73YFa+Kc/A130VsAdX68SpsJwARMM=
|
||||
github.com/aws/smithy-go v1.27.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
|
||||
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
|
||||
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
|
||||
github.com/bazelbuild/rules_go v0.46.0 h1:CTefzjN/D3Cdn3rkrM6qMWuQj59OBcuOjyIp3m4hZ7s=
|
||||
@@ -775,8 +773,6 @@ github.com/boombuler/barcode v1.1.0 h1:ChaYjBR63fr4LFyGn8E8nt7dBSt3MiU3zMOZqFvVk
|
||||
github.com/boombuler/barcode v1.1.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/bradenaw/juniper v0.15.3 h1:RHIAMEDTpvmzV1wg1jMAHGOoI2oJUSPx3lxRldXnFGo=
|
||||
github.com/bradenaw/juniper v0.15.3/go.mod h1:UX4FX57kVSaDp4TPqvSjkAAewmRFAfXf27BOs5z9dq8=
|
||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 h1:GKTyiRCL6zVf5wWaqKnf+7Qs6GbEPfd4iMOitWzXJx8=
|
||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8/go.mod h1:spo1JLcs67NmW1aVLEgtA8Yy1elc+X8y5SRW1sFW4Og=
|
||||
github.com/broady/gogeohash v0.0.0-20120525094510-7b2c40d64042 h1:iEdmkrNMLXbM7ecffOAtZJQOQUTE4iMonxrb5opUgE4=
|
||||
github.com/broady/gogeohash v0.0.0-20120525094510-7b2c40d64042/go.mod h1:f1L9YvXvlt9JTa+A17trQjSMM6bV40f+tHjB+Pi+Fqk=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||
@@ -789,8 +785,8 @@ github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/
|
||||
github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c=
|
||||
github.com/buger/goterm v1.0.4 h1:Z9YvGmOih81P0FbVtEYTFF6YsSgxSUKEhf/f9bTMXbY=
|
||||
github.com/buger/goterm v1.0.4/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE=
|
||||
github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk=
|
||||
github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||
github.com/buger/jsonparser v1.2.0 h1:4EFcvK1kD4jyj6YqNK6skK6w+y7FHHBR+XBCtxwu/6g=
|
||||
github.com/buger/jsonparser v1.2.0/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
|
||||
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
|
||||
@@ -825,12 +821,12 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
|
||||
github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I=
|
||||
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
|
||||
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.15.0 h1:iLoIwb7BJECHTbNcmIhYDsQhoZiACWGNvEpyqQy97Dk=
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.15.0/go.mod h1:ireC4gqVetsjVhYlwjUJwKTbZuWjEIynbR9zQTlqsvo=
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20250228001242-d4c70e6251cc h1:t8YjNUCt1DimB4HCIXBztwWMhgxr5yG5/YaRl9Afdfg=
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20250228001242-d4c70e6251cc/go.mod h1:CgWpFCFWzzEA5hVkhAc6DZZzGd3czx+BblvOzjmg6KA=
|
||||
github.com/cloudflare/circl v1.6.4 h1:pOXuDTCEYyzydgUpQ0CQz3LsinKjiSk6nNP5Lt5K64U=
|
||||
github.com/cloudflare/circl v1.6.4/go.mod h1:YxarevkLlbaHuWsxG6vmYNWBEsSp4pnp7j+4VljMavY=
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.16.0 h1:0irPbKwRB6V6sdP9+a4P4D5sRUYHXriG5GfTjVq4YBI=
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.16.0/go.mod h1:ireC4gqVetsjVhYlwjUJwKTbZuWjEIynbR9zQTlqsvo=
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20260701064823-d8c5600d73b8 h1:+KC2I+emnT6ccWmo7IHbtchGc/vFqAxUuovo2eUgMuM=
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20260701064823-d8c5600d73b8/go.mod h1:1pQXB0vAlzRlqcY7LYKOOZMw0wKfJPFxTLsJRF2Gswo=
|
||||
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc h1:0xCWmFKBmarCqqqLeM7jFBSw/Or81UEElFqO8MY+GDs=
|
||||
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc/go.mod h1:uvR42Hb/t52HQd7x5/ZLzZEK8oihrFpgnodIJ1vte2E=
|
||||
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
||||
@@ -922,8 +918,8 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WA
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/diskfs/go-diskfs v1.7.0 h1:vonWmt5CMowXwUc79jWyGrf2DIMeoOjkLlMnQYGVOs8=
|
||||
github.com/diskfs/go-diskfs v1.7.0/go.mod h1:LhQyXqOugWFRahYUSw47NyZJPezFzB9UELwhpszLP/k=
|
||||
github.com/diskfs/go-diskfs v1.9.4 h1:0j2d7eG4IjyxL6+ChWbDPocdBCF6HQ4HBWU2WDYWVnc=
|
||||
github.com/diskfs/go-diskfs v1.9.4/go.mod h1:TePJORO83Adh5pb2SqsxAwaP0fofFxKLkxctiS/9OQc=
|
||||
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
|
||||
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||
github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c=
|
||||
@@ -947,8 +943,8 @@ github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD
|
||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
||||
github.com/dromara/dongle v1.0.1 h1:si/7UP/EXxnFVZok1cNos70GiMGxInAYMilHQFP5dJs=
|
||||
github.com/dromara/dongle v1.0.1/go.mod h1:ebFhTaDgxaDIKppycENTWlBsxz8mWCPWOLnsEgDpMv4=
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5 h1:FT+t0UEDykcor4y3dMVKXIiWJETBpRgERYTGlmMd7HU=
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5/go.mod h1:rSS3kM9XMzSQ6pw91Qgd6yB5jdt70N4OdtrAf74As5M=
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.4.0 h1:OYMx56y2as2FIM6QuS5HGXC2AYtf5xv/2n6INaluF4Y=
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.4.0/go.mod h1:gDXhl0OElhzYoDsYWHr1RXjpxjGeLzEvjYzH7sZV73k=
|
||||
github.com/dsnet/try v0.0.3 h1:ptR59SsrcFUYbT/FhAbKTV6iLkeD6O18qfIWRml2fqI=
|
||||
github.com/dsnet/try v0.0.3/go.mod h1:WBM8tRpUmnXXhY1U6/S8dt6UWdHTQ7y8A5YSkRCkq40=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
@@ -960,18 +956,18 @@ github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4A
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0=
|
||||
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
|
||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/ISU=
|
||||
github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||
github.com/ebitengine/purego v0.10.1 h1:dewVBCBT2GaMu1SrNTYxQhgQBethzfhiwvZiLGP/qyY=
|
||||
github.com/ebitengine/purego v0.10.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 h1:XBBHcIb256gUJtLmY22n99HaZTz+r2Z51xUPi01m3wg=
|
||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203/go.mod h1:E1jcSv8FaEny+OP/5k9UxZVw9YFWGj7eI4KR/iOBqCg=
|
||||
github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=
|
||||
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
|
||||
github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab h1:h1UgjJdAAhj+uPL68n7XASS6bU+07ZX1WJvVS2eyoeY=
|
||||
github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab/go.mod h1:GLo/8fDswSAniFG+BFIaiSPcK610jyzgEhWYPQwuQdw=
|
||||
github.com/elliotwutingfeng/asciiset v0.0.0-20260129054604-cfde2086bc57 h1:x5yxNrq8XffV/OoNUeFPM6hxHVi5OTspSTBxr/9pemg=
|
||||
github.com/elliotwutingfeng/asciiset v0.0.0-20260129054604-cfde2086bc57/go.mod h1:GLo/8fDswSAniFG+BFIaiSPcK610jyzgEhWYPQwuQdw=
|
||||
github.com/emersion/go-message v0.18.2 h1:rl55SQdjd9oJcIoQNhubD2Acs1E6IzlZISRTK7x/Lpg=
|
||||
github.com/emersion/go-message v0.18.2/go.mod h1:XpJyL70LwRvq2a8rVbHXikPgKj8+aI0kGdHlg16ibYA=
|
||||
github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff h1:4N8wnS3f1hNHSmFD5zgFkWCyA4L1kCDkImPAtK7D6tg=
|
||||
github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM=
|
||||
github.com/emersion/go-vcard v0.0.0-20260618161152-d854b7e0e2d3 h1:B9YK+Tck5mTccyDhtxBzWyqGYcFxLyB6+noMNW4/VgI=
|
||||
github.com/emersion/go-vcard v0.0.0-20260618161152-d854b7e0e2d3/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM=
|
||||
github.com/emmansun/gmsm v0.15.5/go.mod h1:2m4jygryohSWkaSduFErgCwQKab5BNjURoFrn2DNwyU=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
@@ -1011,8 +1007,8 @@ github.com/fanixk/geohash v0.0.0-20150324002647-c1f9b5fa157a/go.mod h1:UgNw+PTmm
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
|
||||
github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE=
|
||||
github.com/fluent/fluent-logger-golang v1.10.1 h1:wu54iN1O2afll5oQrtTjhgZRwWcfOeFFzwRsEkABfFQ=
|
||||
github.com/fluent/fluent-logger-golang v1.10.1/go.mod h1:qOuXG4ZMrXaSTk12ua+uAb21xfNYOzn0roAtp7mfGAE=
|
||||
github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=
|
||||
@@ -1044,8 +1040,8 @@ github.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=
|
||||
github.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 h1:BP4M0CvQ4S3TGls2FvczZtj5Re/2ZzkV9VwqPHH/3Bo=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
|
||||
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
|
||||
github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=
|
||||
github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
|
||||
github.com/go-darwin/apfs v0.0.0-20211011131704-f84b94dbf348 h1:JnrjqG5iR07/8k7NqrLNilRsl3s1EPRQEGvbPyOce68=
|
||||
github.com/go-darwin/apfs v0.0.0-20211011131704-f84b94dbf348/go.mod h1:Czxo/d1g948LtrALAZdL04TL/HnkopquAjxYUuI02bo=
|
||||
github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk=
|
||||
@@ -1080,12 +1076,12 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
|
||||
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
|
||||
github.com/go-openapi/errors v0.22.6 h1:eDxcf89O8odEnohIXwEjY1IB4ph5vmbUsBMsFNwXWPo=
|
||||
github.com/go-openapi/errors v0.22.6/go.mod h1:z9S8ASTUqx7+CP1Q8dD8ewGH/1JWFFLX/2PmAYNQLgk=
|
||||
github.com/go-openapi/strfmt v0.25.0 h1:7R0RX7mbKLa9EYCTHRcCuIPcaqlyQiWNPTXwClK0saQ=
|
||||
github.com/go-openapi/strfmt v0.25.0/go.mod h1:nNXct7OzbwrMY9+5tLX4I21pzcmE6ccMGXl3jFdPfn8=
|
||||
github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls=
|
||||
github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
|
||||
github.com/go-openapi/errors v0.22.8 h1:oP7sW7TWc3wFFjrzzj0nI83H2qMBkNjNfSd+XRejk/I=
|
||||
github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w=
|
||||
github.com/go-openapi/strfmt v0.27.0 h1:kbcTeaD9TXuXD0hhMXzuYa1sdTo6+dWGvwjW93E80IM=
|
||||
github.com/go-openapi/strfmt v0.27.0/go.mod h1:s/qhDqfY72irigXUGJmtgid2Rm+3tnz3k8hZaRmvWYc=
|
||||
github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug=
|
||||
github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
|
||||
github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
|
||||
github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
|
||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||
@@ -1094,8 +1090,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.30.1 h1:f3zDSN/zOma+w6+1Wswgd9fLkdwy06ntQJp0BBvFG0w=
|
||||
github.com/go-playground/validator/v10 v10.30.1/go.mod h1:oSuBIQzuJxL//3MelwSLD5hc2Tu889bF0Idm9Dg26cM=
|
||||
github.com/go-playground/validator/v10 v10.30.3 h1:4MU6YkEwx7GbcPJOZxrtbu+QfF3pJLJuaYTeAH0DYy8=
|
||||
github.com/go-playground/validator/v10 v10.30.3/go.mod h1:4Axh7oCNGcoGkqLoE4YWt6n20mcEIsPRlB7vPk3lpyc=
|
||||
github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
|
||||
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
|
||||
github.com/go-redis/redis/v7 v7.4.1 h1:PASvf36gyUpr2zdOUS/9Zqc80GbM+9BDyiJSJDDOrTI=
|
||||
@@ -1206,7 +1202,6 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/go-replayers/grpcreplay v1.3.0 h1:1Keyy0m1sIpqstQmgz307zhiJ1pV4uIlFds5weTmxbo=
|
||||
@@ -1373,8 +1368,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf h1:FtEj8sfIcaaBfAKrE1Cwb61YDtYq9JxChK1c7AKce7s=
|
||||
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf/go.mod h1:yrqSXGoD/4EKfF26AOGzscPOgTTJcyAwM2rpixWT+t4=
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260331173834-036f908d0160 h1:PV6ipOJN0JIek4dqPqsTtenQmjI1SZntCUgPzhfk9gM=
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260331173834-036f908d0160/go.mod h1:yRuPDnHgGmsbvopF0amMqXxr4n32GynzX5GTwFYDHaw=
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260708165336-dd6561bacfa2 h1:ZeebPK9Bnpy40uTuneEeVMYaMMerol3qsmIvzD0EIAk=
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260708165336-dd6561bacfa2/go.mod h1:4jGLEnNHyWOVSGn89IeWUVqlKCEitOM3D32/XypGy/o=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||
@@ -1451,13 +1446,13 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
|
||||
github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE=
|
||||
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
|
||||
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/klauspost/compress v1.19.0 h1:sXLILfc9jV2QYWkzFOPWStmcUVH2RHEB1JCdY2oVvCQ=
|
||||
github.com/klauspost/compress v1.19.0/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||
github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=
|
||||
github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
|
||||
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw=
|
||||
github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU=
|
||||
github.com/klauspost/reedsolomon v1.14.1 h1:swE9kzyWXD/wVG+l5Pe8bWnQ0giIY7D1GjCBKk3kG2U=
|
||||
github.com/klauspost/reedsolomon v1.14.1/go.mod h1:yjqqjgMTQkBUHSG97/rm4zipffCNbCiZcB3kTqr++sQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
@@ -1497,31 +1492,31 @@ github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8
|
||||
github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4=
|
||||
github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8=
|
||||
github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts=
|
||||
github.com/lpar/date v1.0.0 h1:bq/zVqFTUmsxvd/CylidY4Udqpr9BOFrParoP6p0x/I=
|
||||
github.com/lpar/date v1.0.0/go.mod h1:KjYe0dDyMQTgpqcUz4LEIeM5VZwhggjVx/V2dtc8NSo=
|
||||
github.com/lufia/plan9stats v0.0.0-20260216142805-b3301c5f2a88 h1:PTw+yKnXcOFCR6+8hHTyWBeQ/P4Nb7dd4/0ohEcWQuM=
|
||||
github.com/lufia/plan9stats v0.0.0-20260216142805-b3301c5f2a88/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
|
||||
github.com/lpar/calendar v0.2.0 h1:A1kxv6sbvBHFUkd2XotanIRqEXQGreQOeuGhkJqIaRA=
|
||||
github.com/lpar/calendar v0.2.0/go.mod h1:fsVJa4o2NvXYzaCE5RXMadqbZzWEhNCGOUPVHTIZdjc=
|
||||
github.com/lufia/plan9stats v0.0.0-20260627054121-477a66015f15 h1:YkjVPl/YH5XlJ+/NiwzJtPYXXKRcyjmEUhsDci6YK3c=
|
||||
github.com/lufia/plan9stats v0.0.0-20260627054121-477a66015f15/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
|
||||
github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
|
||||
github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
|
||||
github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o=
|
||||
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
|
||||
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8=
|
||||
github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||
github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M=
|
||||
github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY=
|
||||
github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4=
|
||||
github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
|
||||
github.com/mattn/go-isatty v0.0.23 h1:cYwCQTQf3HB6xUC+BtyCLZNr7IzbOmoZbmssVNzSyiQ=
|
||||
github.com/mattn/go-isatty v0.0.23/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
|
||||
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-runewidth v0.0.22 h1:76lXsPn6FyHtTY+jt2fTTvsMUCZq1k0qwRsAMuxzKAk=
|
||||
github.com/mattn/go-runewidth v0.0.22/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
|
||||
github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU=
|
||||
github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
|
||||
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
|
||||
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||
@@ -1609,6 +1604,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
|
||||
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
|
||||
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s=
|
||||
github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
|
||||
github.com/olivere/elastic/v7 v7.0.32 h1:R7CXvbu8Eq+WlsLgxmKVKPox0oOwAE/2T9Si5BnvK6E=
|
||||
github.com/olivere/elastic/v7 v7.0.32/go.mod h1:c7PVmLe3Fxq77PIfY/bZmxY/TAamBhCzZ8xDOE09a9k=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
@@ -1629,12 +1626,12 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+
|
||||
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
|
||||
github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg=
|
||||
github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c=
|
||||
github.com/oracle/oci-go-sdk/v65 v65.111.0 h1:eDkWg6ZN0uKwWzSekoFcQJhR+C+F/aVdTwr+lGHU9Qk=
|
||||
github.com/oracle/oci-go-sdk/v65 v65.111.0/go.mod h1:8ZzvzuEG/cFLFZhxg/Mg1w19KqyXBKO3c17QIc5PkGs=
|
||||
github.com/oracle/oci-go-sdk/v65 v65.121.0 h1:1J+5ARgrodrx8kzFy/hxznaoUzz43jr0EestCzEaOHw=
|
||||
github.com/oracle/oci-go-sdk/v65 v65.121.0/go.mod h1:Pzy+BpgkDesvGZXEHgslwhIYobHCPHg6wRta1mWnlqQ=
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1 h1:jOJ5Pg2w1oeB6PeDurIYf6k9PQ+aTITr/6lP/L/zp6c=
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1/go.mod h1:9Eq3TG2oBe5FirmYWQfYO5iH1q0Jv47PLaNK++uCdOM=
|
||||
github.com/panjf2000/ants/v2 v2.11.5 h1:a7LMnMEeux/ebqTux140tRiaqcFTV0q2bEHF03nl6Rg=
|
||||
github.com/panjf2000/ants/v2 v2.11.5/go.mod h1:8u92CYMUc6gyvTIw8Ru7Mt7+/ESnJahz5EVtqfrilek=
|
||||
github.com/panjf2000/ants/v2 v2.12.1 h1:BWvU2wHpyXWxhhNXsGB6JXLCNbshyLd1QxvoAmZnu10=
|
||||
github.com/panjf2000/ants/v2 v2.12.1/go.mod h1:tSQuaNQ6r6NRhPt+IZVUevvDyFMTs+eS4ztZc52uJTY=
|
||||
github.com/parquet-go/bitpack v1.0.0 h1:AUqzlKzPPXf2bCdjfj4sTeacrUwsT7NlcYDMUQxPcQA=
|
||||
github.com/parquet-go/bitpack v1.0.0/go.mod h1:XnVk9TH+O40eOOmvpAVZ7K2ocQFrQwysLMnc6M/8lgs=
|
||||
github.com/parquet-go/jsonlite v1.0.0 h1:87QNdi56wOfsE5bdgas0vRzHPxfJgzrXGml1zZdd7VU=
|
||||
@@ -1645,6 +1642,7 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw
|
||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||
github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||
github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 h1:XeOYlK9W1uCmhjJSsY78Mcuh7MVkNjTzmHx1yBzizSU=
|
||||
@@ -1712,8 +1710,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn
|
||||
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
|
||||
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||
github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
|
||||
github.com/prometheus/client_golang v1.24.0 h1:5XStIklKuAtJSNpdD3s8XJj/Yv78IQmE1kbNk87JrAI=
|
||||
github.com/prometheus/client_golang v1.24.0/go.mod h1:QcsNdotprC2nS4BTM2ucbcqxd2CeXTEa9jW7zHO9iDE=
|
||||
github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU=
|
||||
github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
@@ -1725,8 +1723,8 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
|
||||
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||
github.com/prometheus/common v0.70.0 h1:bcpru3tWPVnxGnETLgOV5jbp/JRXgYEyv65CuBLAMMI=
|
||||
github.com/prometheus/common v0.70.0/go.mod h1:S/SFasQmgGiYH6C81LKCtYa8QACgthGg5zxL2udV7SY=
|
||||
github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi/PY=
|
||||
github.com/prometheus/common v0.70.1/go.mod h1:VdFUQDMZK3VLkurFUVhia6uys/0suUp86TJz5qbJRhc=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
@@ -1753,12 +1751,12 @@ github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SA
|
||||
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||
github.com/rabbitmq/amqp091-go v1.11.0 h1:HxIctVm9Gid/Vtn706necmZ7Wj6pgGI2eqplRbEY8O8=
|
||||
github.com/rabbitmq/amqp091-go v1.11.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.3 h1:Bs7RC4xCFSN0BPIYVda/BNxp0qo3NV0gB2VZqx2KIew=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.3/go.mod h1:26RAest751Ofk+F/d8xtl4UyWXrZvMQwn39U8rm/WKM=
|
||||
github.com/rclone/go-proton-api v1.0.2 h1:cJtJUab0MGJ3C6q5kiEJs3pbyhSLnOKMyYOQehA0PBc=
|
||||
github.com/rclone/go-proton-api v1.0.2/go.mod h1:LB2kCEaZMzNn3ocdz+qYfxXmuLxxN0ka62KJd2x53Bc=
|
||||
github.com/rclone/rclone v1.74.3 h1:a2wln7pvEa0tS1WIZJKulEkVjxgC1DkCoyxYydkdiSY=
|
||||
github.com/rclone/rclone v1.74.3/go.mod h1:t5Mh86PO49DD7xlPt0trnK/aNf2Z3M0uip4l1Jqwiv8=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.4 h1:uGQJRjQC1hVLd5kqLsXc6CWO6oqrVeLoKQYoHapEZDg=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.4/go.mod h1:VTPBYZotKAeDLlAzxU2O/s14NXk9FxUt9hn1jhH2iY8=
|
||||
github.com/rclone/go-proton-api v1.0.3 h1:3gBTzR+j0dYiTwtj9yKIdN/aV3W2a8KIPKp0GArojyQ=
|
||||
github.com/rclone/go-proton-api v1.0.3/go.mod h1:QAlkFfswzrBuxvCORWV8rZdddg52hahMN98CFWoFW1E=
|
||||
github.com/rclone/rclone v1.75.0 h1:3ARHem4jXWltvl+b0PvDAG8s6J/inHd5BRzfwMRb3W8=
|
||||
github.com/rclone/rclone v1.75.0/go.mod h1:PGLJUW/WSIJCysALqUcxmaCFyfMXUevf8CbuoOwsAdU=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rdleal/intervalst v1.5.0 h1:SEB9bCFz5IqD1yhfH1Wv8IBnY/JQxDplwkxHjT6hamU=
|
||||
@@ -1786,8 +1784,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/rogpeppe/go-internal v1.15.0 h1:D0RCU5rMAp+SpgkiNdrjfJ+LX4J1M32V2NeCY7EJ6hc=
|
||||
github.com/rogpeppe/go-internal v1.15.0/go.mod h1:DrUVZyrJU+txYW5/1kwtXQSMFio52ZOxX7yM1VHvnxs=
|
||||
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
|
||||
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
|
||||
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
|
||||
@@ -1798,8 +1796,8 @@ github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDj
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
|
||||
github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=
|
||||
github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=
|
||||
github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
|
||||
github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
|
||||
github.com/samber/lo v1.53.0 h1:t975lj2py4kJPQ6haz1QMgtId2gtmfktACxIXArw3HM=
|
||||
github.com/samber/lo v1.53.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
|
||||
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw=
|
||||
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
|
||||
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
|
||||
@@ -1808,8 +1806,8 @@ github.com/schollz/progressbar/v3 v3.19.1 h1:iv8BgwOvdML/S3p84uBpy/IMigv4U9594vP
|
||||
github.com/schollz/progressbar/v3 v3.19.1/go.mod h1:LFL7jqimKxfhero4K1eCkUr/6R39AgQeiPCJtlTWIW8=
|
||||
github.com/seaweedfs/cockroachdb-parser v0.0.0-20260225204133-2f342c5ea564 h1:TgxPraf1NmF6XTcUG53ULpLQrKvhtUJxQ3hyekxSDNQ=
|
||||
github.com/seaweedfs/cockroachdb-parser v0.0.0-20260225204133-2f342c5ea564/go.mod h1:JSKCh6uCHBz91lQYFYHCyTrSVIPge4SUFVn28iwMNB0=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.3 h1:rJufGrHImTx7yoGUmetUi+To4LrmTQJROJnBHWt92ic=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.3/go.mod h1:zABdmWEa6A0bwaBeEOBUeUkGIZlxUhcdv+V1Dcc/U/I=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.4 h1:ACyloiuopdhRSjdLLeSWbsVaemMPskORaRF01TY6GyM=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.4/go.mod h1:zABdmWEa6A0bwaBeEOBUeUkGIZlxUhcdv+V1Dcc/U/I=
|
||||
github.com/seaweedfs/goexif v1.0.3 h1:ve/OjI7dxPW8X9YQsv3JuVMaxEyF9Rvfd04ouL+Bz30=
|
||||
github.com/seaweedfs/goexif v1.0.3/go.mod h1:Oni780Z236sXpIQzk1XoJlTwqrJ02smEin9zQeff7Fk=
|
||||
github.com/seaweedfs/raft v1.2.0 h1:Ez4Hw9ifBbTT7wg54DvGHBjw1vRlTb4roH0TKl0Oj9Y=
|
||||
@@ -1845,6 +1843,8 @@ github.com/snabb/httpreaderat v1.0.1 h1:whlb+vuZmyjqVop8x1EKOg05l2NE4z9lsMMXjmSU
|
||||
github.com/snabb/httpreaderat v1.0.1/go.mod h1:lpbGrKDWF37yvRbtRvQsbesS6Ty5c83t8ztannPoMsA=
|
||||
github.com/sony/gobreaker v1.0.0 h1:feX5fGGXSl3dYd4aHZItw+FpHLvvoaqkawKjVNiFMNQ=
|
||||
github.com/sony/gobreaker v1.0.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
|
||||
github.com/sony/gobreaker/v2 v2.4.0 h1:g2KJRW1Ubty3+ZOcSEUN7K+REQJdN6yo6XvaML+jptg=
|
||||
github.com/sony/gobreaker/v2 v2.4.0/go.mod h1:pTyFJgcZ3h2tdQVLZZruK2C0eoFL1fb/G83wK1ZQl+s=
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=
|
||||
github.com/spacemonkeygo/monkit/v3 v3.0.25-0.20251022131615-eb24eb109368 h1:GyYC5Ntqk/yy9lEIGE7chdIvt4zP44taycwd9YDSGdc=
|
||||
@@ -1863,8 +1863,8 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
|
||||
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
|
||||
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
|
||||
github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo=
|
||||
github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs=
|
||||
github.com/spiffe/go-spiffe/v2 v2.8.1 h1:eXZMLsu+3MLEPJyGJkolqtVrteZfQdUpOWj6LTiDl/E=
|
||||
github.com/spiffe/go-spiffe/v2 v2.8.1/go.mod h1:47Q0Q9/AqGha8QLHp+kxpH4Wca7X7EnOtlIJy3mxZ3U=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
@@ -1894,14 +1894,14 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/substrait-io/substrait v0.87.0 h1:40rP4LejyK6SNQlWz7NX6kQELf8cmScWMBGruWhN4io=
|
||||
github.com/substrait-io/substrait v0.87.0/go.mod h1:MPFNw6sToJgpD5Z2rj0rQrdP/Oq8HG7Z2t3CAEHtkHw=
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.0 h1:58nSM6Qsctke4DIHU2y4aR8FN5YC7syo1mk4zFKAo4U=
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.0/go.mod h1:6GLz9k21udB64g4lLKq8632TKfQCRAVfhuU3NSXtZWY=
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.1 h1:XL7CqVVOQkXP9FRSIm2ylJCjqRASg1yBRcn5nRCRwss=
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.1/go.mod h1:6GLz9k21udB64g4lLKq8632TKfQCRAVfhuU3NSXtZWY=
|
||||
github.com/substrait-io/substrait-protobuf/go v0.85.0 h1:zk6MtNWLtDSl8a7qCZRFH0+EIIXVrrd/hsgYK/SQTgM=
|
||||
github.com/substrait-io/substrait-protobuf/go v0.85.0/go.mod h1:hn+Szm1NmZZc91FwWK9EXD/lmuGBSRTJ5IvHhlG1YnQ=
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw=
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20251120131202-6845944c051c h1:dtcOwRimeiBFrlutmF6K94l0rxYFARNFMA+lSQ41C+M=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20251120131202-6845944c051c/go.mod h1:BF/l2jNyK+2h/BJZ7VLMAz6m/IWjA2F67gTjV1C/+Bo=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20260717075258-c6acd6a5bd04 h1:s30A8dMuZ55lUOi5xUTh1hlfLqHpVBsRMfpk2iKCayk=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20260717075258-c6acd6a5bd04/go.mod h1:BF/l2jNyK+2h/BJZ7VLMAz6m/IWjA2F67gTjV1C/+Bo=
|
||||
github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8=
|
||||
github.com/tarantool/go-iproto v1.1.0 h1:HULVOIHsiehI+FnHfM7wMDntuzUddO09DKqu2WnFQ5A=
|
||||
github.com/tarantool/go-iproto v1.1.0/go.mod h1:LNCtdyZxojUed8SbOiYHoc3v9NvaZTB7p96hUySMlIo=
|
||||
@@ -1931,12 +1931,12 @@ github.com/tikv/pd/client v0.0.0-20230329114254-1948c247c2b1/go.mod h1:3cTcfo8GR
|
||||
github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375 h1:QB54BJwA6x8QU9nHY3xJSZR2kX9bgpZekRKGkLTmEXA=
|
||||
github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375/go.mod h1:xRroudyp5iVtxKqZCrA6n2TLFRBf8bmnjr1UD4x+z7g=
|
||||
github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
|
||||
github.com/tinylib/msgp v1.6.3 h1:bCSxiTz386UTgyT1i0MSCvdbWjVW+8sG3PjkGsZQt4s=
|
||||
github.com/tinylib/msgp v1.6.3/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA=
|
||||
github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA=
|
||||
github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI=
|
||||
github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw=
|
||||
github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ=
|
||||
github.com/tinylib/msgp v1.6.4 h1:mOwYbyYDLPj35mkA2BjjYejgJk9BuHxDdvRnb6v2ZcQ=
|
||||
github.com/tinylib/msgp v1.6.4/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA=
|
||||
github.com/tklauser/go-sysconf v0.4.0 h1:7H0uAN+7RkwWRaxhYXDLqa5V3LPrJeV8wmD9dRUgPQU=
|
||||
github.com/tklauser/go-sysconf v0.4.0/go.mod h1:8mTNWyog7H+MpKijp4VmKJAd2bbYQ2zuUwkYRbUArPI=
|
||||
github.com/tklauser/numcpus v0.12.0 h1:NR85qdvHA9pFse3x3weVZ0r0ST8R6l5RHbZrlRaqob4=
|
||||
github.com/tklauser/numcpus v0.12.0/go.mod h1:ABHeXzJnr/qqwguhClkZKT1/8VABcYrsyUiUGobwWJg=
|
||||
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
|
||||
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
|
||||
github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 h1:r0p7fK56l8WPequOaR3i9LBqfPtEdXIQbUTzT55iqT4=
|
||||
@@ -1998,6 +1998,8 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
|
||||
github.com/winfsp/cgofuse v1.6.1-0.20260126094232-f2c4fccdb286 h1:tw5GqRXqExB/xghPoPLtVujBe9w9Pg1G78tvXCJNJAA=
|
||||
github.com/winfsp/cgofuse v1.6.1-0.20260126094232-f2c4fccdb286/go.mod h1:uxjoF2jEYT3+x+vC2KJddEGdk/LU8pRowXmyVMHSV5I=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
|
||||
github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ=
|
||||
@@ -2034,8 +2036,8 @@ github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.2 h1:e2nGQPGC5OEPBWlMnLPFpd
|
||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.2/go.mod h1:9YzkhlIymWaJGX6KMU3vh5sOf3UKbCXkG/ZdjaI3zNM=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.44.0/go.mod h1:oSLwnuilwIpaF5bJJMAofnGgzPJusoI3zWMNb8I+GnM=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.47.3/go.mod h1:bWnOIcUHd7+Sl7DN+yhyY1H/I61z53GczvwJgXMgvj0=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.144.5 h1:FRDqbsrIUBjhgP0laLYiw+22kGT0JqPdeDY5Yejo6SE=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.144.5/go.mod h1:b9NEO6mgaiqsnOMkS003uS82XsKh6GL+ZTFfPqXWz+c=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.146.3 h1:0ybsLjWJ25M8XXGXk7NfjhO+s8bqBcGGWt8iB2DQiHQ=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.146.3/go.mod h1:b9NEO6mgaiqsnOMkS003uS82XsKh6GL+ZTFfPqXWz+c=
|
||||
github.com/ydb-platform/ydb-go-yc v0.12.1 h1:qw3Fa+T81+Kpu5Io2vYHJOwcrYrVjgJlT6t/0dOXJrA=
|
||||
github.com/ydb-platform/ydb-go-yc v0.12.1/go.mod h1:t/ZA4ECdgPWjAb4jyDe8AzQZB5dhpGbi3iCahFaNwBY=
|
||||
github.com/ydb-platform/ydb-go-yc-metadata v0.6.1 h1:9E5q8Nsy2RiJMZDNVy0A3KUrIMBPakJ2VgloeWbcI84=
|
||||
@@ -2069,8 +2071,8 @@ github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
||||
github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s=
|
||||
go.einride.tech/aip v0.83.0 h1:TI21IdeOnLTwZEJ3BxtImIZk6bsN2Q+sd0x99SLiQ+M=
|
||||
go.einride.tech/aip v0.83.0/go.mod h1:E8+wdTApA70odnpFzJgsGogHozC2JCIhFJBKPr8bVig=
|
||||
go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo=
|
||||
go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E=
|
||||
go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU=
|
||||
go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk=
|
||||
go.etcd.io/etcd/api/v3 v3.6.12 h1:OLOZUKEuAA36TR48F0cIaa8FdzrWygjyfrJxXg4iDgs=
|
||||
go.etcd.io/etcd/api/v3 v3.6.12/go.mod h1:p14EIQXHbuOQbVvL/WEes5uqKnxP9AgKJgpjbMVvzvE=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.12 h1:36zzB+pQOdHbhN+kH2iJz/K8bJn0ZLtLfPPO7jozTDo=
|
||||
@@ -2090,14 +2092,14 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.43.0 h1:62yY3dT7/ShwOxzA0RsKRgshBmfElKI4d/Myu2OxDFU=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.43.0/go.mod h1:RyaZMFY7yi1kAs45S6mbFGz8O8rqB0dTY14uzvG4LCs=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.44.0 h1:NmLfL734pJhM0JKaYd2Y28+nY9dPRWYAAbxhRCrKXPw=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 h1:0Qx7VGBacMm9ZENQ7TnNObTYI4ShC+lHI16seduaxZo=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0/go.mod h1:Sje3i3MjSPKTSPvVWCaL8ugBzJwik3u4smCjUeuupqg=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0 h1:2pn7OzMewmYRiNtv1doZnLo3gONcnMHlFnmOR8Vgt+8=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0/go.mod h1:rjbQTDEPQymPE0YnRQp9/NuPwwtL0sesz/fnqRW/v84=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 h1:OyrsyzuttWTSur2qN/Lm0m2a8yqyIjUVBZcxFPuXq2o=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0/go.mod h1:C2NGBr+kAB4bk3xtMXfZ94gqFDtg/GkI7e9zqGh5Beg=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI=
|
||||
go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
|
||||
go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.42.0 h1:MdKucPl/HbzckWWEisiNqMPhRrAOQX8r4jTuGr636gk=
|
||||
@@ -2180,9 +2182,6 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
|
||||
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
@@ -2200,8 +2199,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
|
||||
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM=
|
||||
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80=
|
||||
golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597 h1:qLvzZeaANDgyVOA8pyHCOStGlXn0rseXma+GQjeuv2g=
|
||||
golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597/go.mod h1:EdfpwwqSu+0Li0mzskwHU6FWDV3t9Q+RZDo3QMUtL3Q=
|
||||
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
@@ -2215,8 +2214,8 @@ golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeap
|
||||
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.43.0 h1:FLxcP4ec2350nTfOC8ysKtqYSIFbk/QGjw1ZHNP4tsY=
|
||||
golang.org/x/image v0.43.0/go.mod h1:rrpelvGFt+kLPAjPM4HeWPgrl0FtafueU//e5N0qk/Q=
|
||||
golang.org/x/image v0.44.0 h1:+tDekMZED9+LrtB3G5xzRggpVh9CARjZqROla3R3R+I=
|
||||
golang.org/x/image v0.44.0/go.mod h1:V8K3KE9KKKE+pLpQDOeN18w9oacNSvy1tDOirTu4xtY=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -2248,10 +2247,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ=
|
||||
golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0=
|
||||
golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk=
|
||||
golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -2316,9 +2313,6 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
|
||||
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
@@ -2369,9 +2363,6 @@ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
|
||||
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||
golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -2475,12 +2466,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
|
||||
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
@@ -2493,9 +2480,6 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
||||
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
|
||||
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -2516,8 +2500,6 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
|
||||
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@@ -2596,9 +2578,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q=
|
||||
golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA=
|
||||
golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE=
|
||||
golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk=
|
||||
golang.org/x/tools/godoc v0.1.0-deprecated h1:o+aZ1BOj6Hsx/GBdJO/s815sqftjSnrZZwyYTHODvtk=
|
||||
golang.org/x/tools/godoc v0.1.0-deprecated/go.mod h1:qM63CriJ961IHWmnWa9CjZnBndniPt4a3CK0PVB9bIg=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@@ -2813,10 +2794,10 @@ google.golang.org/genproto v0.0.0-20230222225845-10f96fb3dbec/go.mod h1:3Dl5ZL0q
|
||||
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s=
|
||||
google.golang.org/genproto v0.0.0-20260519071638-aa98bba5eb94 h1:YJjbgu+dkp5kUJLfpMyCLfBIWZb/FcJyuLeo1gVBOuo=
|
||||
google.golang.org/genproto v0.0.0-20260519071638-aa98bba5eb94/go.mod h1:RRHjglSYABVCWpQ7USCpdfhcd9t4PkajvVwyynZizTc=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 h1:jQ9p21COKWjP3VwuFrNRiiOTMh3mPpN45R7SLrH/HUU=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7/go.mod h1:KqHwBx2upmfa1XSi1WuRvC+2VGCLtooKkfmyvRbUmqA=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800 h1:qEHAMpSaUhtD0p3NbEEI83HwNGFxEwaSJ1G9PLnCBZE=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20260706201446-f0a921348800 h1:admdQBe8jR3VWhBsUrAOaF2Qw6K/+p5pSm1GN8+6Fw4=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20260706201446-f0a921348800/go.mod h1:FPk7EXUKMtImne7AmknoYjT4QXqKIzzRbeQIXzLk6fQ=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260715232425-e75dac1f907d h1:Jkpk39hlTZOIp3RbfvNX9R8Hv+Sw0X89nlU/xFOErsc=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260715232425-e75dac1f907d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
@@ -2857,8 +2838,8 @@ google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsA
|
||||
google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
|
||||
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
|
||||
google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8=
|
||||
google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE=
|
||||
google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA=
|
||||
google.golang.org/grpc v1.84.0-dev.0.20260723093437-b6eac429d7b6 h1:HfjjkdGIa8u9sP9EW5WCygy0kQDuTI/Tax4j//t24Fo=
|
||||
google.golang.org/grpc v1.84.0-dev.0.20260723093437-b6eac429d7b6/go.mod h1:ljCht0DrxQrXBDRTZp52Qxh3Ffk8CdYm2sj4O2QN2C0=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||
google.golang.org/grpc/examples v0.0.0-20250407062114-b368379ef8f6 h1:ExN12ndbJ608cboPYflpTny6mXSzPrDLh0iTaVrRrds=
|
||||
google.golang.org/grpc/examples v0.0.0-20250407062114-b368379ef8f6/go.mod h1:6ytKWczdvnpnO+m+JiG9NjEDzR1FJfsnmJdG7B8QVZ8=
|
||||
@@ -2892,8 +2873,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.67.3 h1:iM9Lhz5MRSGhHVGGwCuzG9KO8PoirCXj/m/qTmOJJQw=
|
||||
gopkg.in/ini.v1 v1.67.3/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss=
|
||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
|
||||
@@ -3003,17 +2984,17 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
|
||||
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
|
||||
storj.io/common v0.0.0-20260225132117-99155641c30a h1:7gSBQY3vhQMIqi3vfaEXR7mreRjcBLfVsYY0rHIN7P0=
|
||||
storj.io/common v0.0.0-20260225132117-99155641c30a/go.mod h1:kyxwKwlfH4paBZCZt/szvRB770ieAIJF73iDy2DpEHw=
|
||||
storj.io/drpc v0.0.35-0.20250513201419-f7819ea69b55 h1:8OE12DvUnB9lfZcHe7IDGsuhjrY9GBAr964PVHmhsro=
|
||||
storj.io/drpc v0.0.35-0.20250513201419-f7819ea69b55/go.mod h1:Y9LZaa8esL1PW2IDMqJE7CFSNq7d5bQ3RI7mGPtmKMg=
|
||||
storj.io/eventkit v0.0.0-20250410172343-61f26d3de156 h1:5MZ0CyMbG6Pi0rRzUWVG6dvpXjbBYEX2oyXuj+tT+sk=
|
||||
storj.io/eventkit v0.0.0-20250410172343-61f26d3de156/go.mod h1:CpnM6kfZV58dcq3lpbo/IQ4/KoutarnTSHY0GYVwnYw=
|
||||
storj.io/common v0.0.0-20260629224719-ba1bff0a7846 h1:TRtVGWm/Y4KAi4coWMxVpydPvBQKYVhkKMar7wu9Zow=
|
||||
storj.io/common v0.0.0-20260629224719-ba1bff0a7846/go.mod h1:1GZnCZNGbzBzaqhG0cUypQeLfNhNIeNY9JVMMiCF14M=
|
||||
storj.io/drpc v1.0.0 h1:1Xf1KCXXbV1viIfN56eqdJ3cNwpAL7OKwQkpS6ksing=
|
||||
storj.io/drpc v1.0.0/go.mod h1:Y9LZaa8esL1PW2IDMqJE7CFSNq7d5bQ3RI7mGPtmKMg=
|
||||
storj.io/eventkit v0.0.0-20260716074419-6861a92e2aa5 h1:JPguPTktHaha9TBEHvuxZmB+mCkiMPgEMOLfosDoE9o=
|
||||
storj.io/eventkit v0.0.0-20260716074419-6861a92e2aa5/go.mod h1:RdWvp249AGm9FZnVKP88y3hFa7vlx9Jf3Cy1P+4EXIU=
|
||||
storj.io/infectious v0.0.2 h1:rGIdDC/6gNYAStsxsZU79D/MqFjNyJc1tsyyj9sTl7Q=
|
||||
storj.io/infectious v0.0.2/go.mod h1:QEjKKww28Sjl1x8iDsjBpOM4r1Yp8RsowNcItsZJ1Vs=
|
||||
storj.io/picobuf v0.0.4 h1:qswHDla+YZ2TovGtMnU4astjvrADSIz84FXRn0qgP6o=
|
||||
storj.io/picobuf v0.0.4/go.mod h1:hSMxmZc58MS/2qSLy1I0idovlO7+6K47wIGUyRZa6mg=
|
||||
storj.io/uplink v1.14.0 h1:J1yXlt0aRr6kgLTHWXOWosNCFVfbamlcyd+CSxyIczo=
|
||||
storj.io/uplink v1.14.0/go.mod h1:2ysmjzd/1Xtz4VKoErNcSqBQz3UC9WKTVuLMV1cNu6E=
|
||||
storj.io/uplink v1.14.3 h1:b89nziD1JgiF6oya+kDSBsqWp9Dzp5ADCUdhA2e2zvs=
|
||||
storj.io/uplink v1.14.3/go.mod h1:jAe47qR+gRnHW2+3THe4cWJBAj8ARZv4P9mguJRo7C4=
|
||||
tags.cncf.io/container-device-interface v1.1.0 h1:RnxNhxF1JOu6CJUVpetTYvrXHdxw9j9jFYgZpI+anSY=
|
||||
tags.cncf.io/container-device-interface v1.1.0/go.mod h1:76Oj0Yqp9FwTx/pySDc8Bxjpg+VqXfDb50cKAXVJ34Q=
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
description: SeaweedFS
|
||||
name: seaweedfs
|
||||
appVersion: "4.40"
|
||||
appVersion: "4.41"
|
||||
# Dev note: Trigger a helm chart release by `git tag -a helm-<version>`
|
||||
version: 4.40.0
|
||||
version: 4.41.0
|
||||
@@ -2739,6 +2739,29 @@ impl Volume {
|
||||
return Err(VolumeError::ReadOnly);
|
||||
}
|
||||
|
||||
// size indexes the needle and places the v3 append timestamp, so a caller using
|
||||
// the payload-only DataSize corrupts both, silently until the needle is read back.
|
||||
if needle_blob.len() < NEEDLE_HEADER_SIZE {
|
||||
return Err(VolumeError::Io(io::Error::new(
|
||||
io::ErrorKind::InvalidData,
|
||||
format!(
|
||||
"needle {} blob of {} bytes is shorter than a needle header",
|
||||
needle_id.0,
|
||||
needle_blob.len()
|
||||
),
|
||||
)));
|
||||
}
|
||||
let (_, _, header_size) = Needle::parse_header(needle_blob);
|
||||
if header_size != size {
|
||||
return Err(VolumeError::Io(io::Error::new(
|
||||
io::ErrorKind::InvalidData,
|
||||
format!(
|
||||
"needle {} size {} does not match its blob header size {}",
|
||||
needle_id.0, size.0, header_size.0
|
||||
),
|
||||
)));
|
||||
}
|
||||
|
||||
// Dedup check: if the same needle already exists with matching content, skip the write.
|
||||
// Matches Go's WriteNeedleBlob which reads existing needle and compares cookie+checksum+data.
|
||||
if let Some(nm) = &self.nm {
|
||||
@@ -3604,7 +3627,7 @@ fn get_append_at_ns(last: u64) -> u64 {
|
||||
/// durable, propagating a sync failure so the commit path can abort rather than
|
||||
/// proceed with an undurable rename or marker. A path with no openable parent is
|
||||
/// tolerated; directory fsync is unsupported on Windows, so it is a no-op there
|
||||
/// (matching the Go fsyncDir helper, which ignores that error).
|
||||
/// (matching the Go fsyncDir helper, which skips it too).
|
||||
pub(crate) fn fsync_dir(path: &str) -> io::Result<()> {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
@@ -4445,6 +4468,39 @@ mod tests {
|
||||
assert!(matches!(err, VolumeError::CookieMismatch(_)));
|
||||
}
|
||||
|
||||
// A size disagreeing with the blob's own header indexes the needle at the wrong
|
||||
// length and, on v3, stamps the append timestamp into the middle of the needle.
|
||||
#[test]
|
||||
fn test_write_needle_blob_rejects_size_mismatch() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
let dir = tmp.path().to_str().unwrap();
|
||||
let mut v = make_test_volume(dir);
|
||||
|
||||
let mut n = Needle {
|
||||
id: NeedleId(1),
|
||||
cookie: Cookie(0x12345678),
|
||||
data: b"the merged payload".to_vec(),
|
||||
data_size: 18,
|
||||
..Needle::default()
|
||||
};
|
||||
n.checksum = CRC::new(&n.data);
|
||||
let (offset, _, _) = v.write_needle(&mut n, true).unwrap();
|
||||
let blob = v.read_needle_blob(offset as i64, n.size).unwrap();
|
||||
|
||||
let dat_size_before = v.dat_file_size().unwrap();
|
||||
|
||||
// Size(n.data_size) is what append reports, and what a caller following the
|
||||
// payload-size convention would send.
|
||||
let err = v
|
||||
.write_needle_blob_and_index(NeedleId(2), &blob, Size(n.data_size as i32))
|
||||
.unwrap_err();
|
||||
assert!(matches!(err, VolumeError::Io(_)), "got {err:?}");
|
||||
assert_eq!(v.dat_file_size().unwrap(), dat_size_before);
|
||||
|
||||
v.write_needle_blob_and_index(NeedleId(2), &blob, n.size)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_volume_destroy() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
|
||||
+2
-1
@@ -181,7 +181,8 @@ GET /api/metrics?days=30
|
||||
# Get one cluster's daily usage history (disk bytes, volumes, volume servers)
|
||||
GET /api/history?cluster_id=<uuid>&days=90
|
||||
|
||||
# Get per-cluster disk usage over time, largest first, the rest summed as "other"
|
||||
# Get per-cluster disk usage and volume servers over time, largest first,
|
||||
# the rest summed as "other"
|
||||
GET /api/cluster-sizes?days=30&limit=20
|
||||
```
|
||||
|
||||
|
||||
@@ -151,20 +151,6 @@ func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request) {
|
||||
<canvas id="osChart" width="400" height="200"></canvas>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="chart-container">
|
||||
<div class="chart-title">Volume Servers Over Time</div>
|
||||
<div class="chart-subtitle">Confirmed clusters only</div>
|
||||
<canvas id="serverChart" width="400" height="200"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="chart-container">
|
||||
<div class="chart-title">Total Disk Usage Over Time</div>
|
||||
<div class="chart-subtitle">Confirmed clusters only</div>
|
||||
<canvas id="diskChart" width="400" height="200"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="chart-container">
|
||||
<div class="chart-title">Cluster Sizes Over Time</div>
|
||||
<div class="chart-subtitle" id="clusterSizesTotal"></div>
|
||||
@@ -173,6 +159,14 @@ func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="chart-container">
|
||||
<div class="chart-title">Volume Servers Over Time</div>
|
||||
<div class="chart-subtitle" id="clusterServersTotal"></div>
|
||||
<div style="position: relative; height: 420px;">
|
||||
<canvas id="serverChart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="chart-container">
|
||||
<div class="chart-title">Per-Cluster History</div>
|
||||
<div class="cluster-lookup">
|
||||
@@ -198,17 +192,13 @@ func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request) {
|
||||
// Load stats
|
||||
const statsResponse = await fetch('/api/stats');
|
||||
const stats = await statsResponse.json();
|
||||
|
||||
// Load metrics
|
||||
const metricsResponse = await fetch('/api/metrics?days=30');
|
||||
const metrics = await metricsResponse.json();
|
||||
|
||||
// Load per-cluster sizes over time
|
||||
const sizesResponse = await fetch('/api/cluster-sizes?days=30&limit=20');
|
||||
const sizes = await sizesResponse.json();
|
||||
|
||||
updateStats(stats);
|
||||
updateCharts(stats, metrics);
|
||||
updateCharts(stats);
|
||||
updateClusterSizes(sizes);
|
||||
|
||||
document.getElementById('loading').style.display = 'none';
|
||||
@@ -227,25 +217,9 @@ func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request) {
|
||||
document.getElementById('totalOS').textContent = Object.keys(stats.os_distribution || {}).length;
|
||||
}
|
||||
|
||||
function updateCharts(stats, metrics) {
|
||||
// Version chart
|
||||
function updateCharts(stats) {
|
||||
createPieChart('versionChart', 'Version Distribution', stats.versions || {});
|
||||
|
||||
// OS chart
|
||||
createPieChart('osChart', 'Operating System Distribution', stats.os_distribution || {});
|
||||
|
||||
|
||||
|
||||
// Server count over time
|
||||
if (metrics.dates && metrics.server_counts) {
|
||||
createLineChart('serverChart', 'Volume Servers', metrics.dates, metrics.server_counts, '#2196F3');
|
||||
}
|
||||
|
||||
// Disk usage over time
|
||||
if (metrics.dates && metrics.disk_usage) {
|
||||
const diskUsageGB = metrics.disk_usage.map(bytes => Math.round(bytes / (1024 * 1024 * 1024)));
|
||||
createLineChart('diskChart', 'Disk Usage (GB)', metrics.dates, diskUsageGB, '#4CAF50');
|
||||
}
|
||||
}
|
||||
|
||||
function createPieChart(canvasId, title, data) {
|
||||
@@ -324,37 +298,50 @@ func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request) {
|
||||
return (unit === 0 ? value : value.toFixed(value >= 100 ? 0 : 1)) + ' ' + units[unit];
|
||||
}
|
||||
|
||||
// One stacked band per cluster over time: the band is that cluster's
|
||||
// size, the top of the stack is the fleet total. Clusters beyond the
|
||||
// requested limit are summed into a trailing "other" band so the stack
|
||||
// still adds up.
|
||||
// Disk usage and volume servers both drawn as one stacked band per
|
||||
// cluster over time: the band is that cluster's share, the top of the
|
||||
// stack is the fleet total. Clusters beyond the requested limit are
|
||||
// summed into a trailing "other" band so the stack still adds up.
|
||||
function updateClusterSizes(series) {
|
||||
const clusters = series.clusters || [];
|
||||
const dates = series.dates || [];
|
||||
const count = series.cluster_count || 0;
|
||||
|
||||
document.getElementById('clusterSizesTotal').textContent =
|
||||
formatBytes(series.total_disk) + ' across ' + count + ' cluster' + (count === 1 ? '' : 's') +
|
||||
const servers = series.total_servers || 0;
|
||||
const across = ' across ' + count + ' cluster' + (count === 1 ? '' : 's') +
|
||||
' on ' + (dates[dates.length - 1] || 'no data');
|
||||
|
||||
document.getElementById('clusterSizesTotal').textContent = formatBytes(series.total_disk) + across;
|
||||
document.getElementById('clusterServersTotal').textContent =
|
||||
servers + ' volume server' + (servers === 1 ? '' : 's') + across;
|
||||
|
||||
clusterSizeIds = clusters.map(c => c.cluster_id);
|
||||
if (series.other) {
|
||||
clusterSizeIds.push(null);
|
||||
}
|
||||
|
||||
stackedChart('clusterSizeChart', dates, clusters, series.other, 'disk', formatBytes);
|
||||
stackedChart('serverChart', dates, clusters, series.other, 'servers', value => value);
|
||||
}
|
||||
|
||||
// The stacks share one cluster order, so a cluster keeps its colour and
|
||||
// its legend entry across both of them.
|
||||
function stackedChart(canvasId, dates, clusters, other, key, format) {
|
||||
const datasets = clusters.map((c, i) => {
|
||||
// Evenly spaced hues keep neighbouring bands distinguishable.
|
||||
const hue = Math.round(i * 360 / clusters.length);
|
||||
return band(c.cluster_id.slice(0, 8), c.disk,
|
||||
return band(c.cluster_id.slice(0, 8), c[key],
|
||||
'hsl(' + hue + ', 65%, 45%)', 'hsla(' + hue + ', 65%, 55%, 0.75)');
|
||||
});
|
||||
if (series.other) {
|
||||
clusterSizeIds.push(null);
|
||||
datasets.push(band('other (' + series.other.count + ')', series.other.disk,
|
||||
if (other) {
|
||||
datasets.push(band('other (' + other.count + ')', other[key],
|
||||
'#9E9E9E', 'rgba(158, 158, 158, 0.6)'));
|
||||
}
|
||||
|
||||
const ctx = document.getElementById('clusterSizeChart').getContext('2d');
|
||||
if (charts.clusterSizeChart) {
|
||||
charts.clusterSizeChart.destroy();
|
||||
const ctx = document.getElementById(canvasId).getContext('2d');
|
||||
if (charts[canvasId]) {
|
||||
charts[canvasId].destroy();
|
||||
}
|
||||
charts.clusterSizeChart = new Chart(ctx, {
|
||||
charts[canvasId] = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: { labels: dates, datasets: datasets },
|
||||
options: {
|
||||
@@ -374,7 +361,7 @@ func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request) {
|
||||
callbacks: {
|
||||
label: item => {
|
||||
const id = clusterSizeIds[item.datasetIndex];
|
||||
return (id || item.dataset.label) + ': ' + formatBytes(item.raw);
|
||||
return (id || item.dataset.label) + ': ' + format(item.raw);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,7 +371,7 @@ func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request) {
|
||||
y: {
|
||||
stacked: true,
|
||||
beginAtZero: true,
|
||||
ticks: { callback: value => formatBytes(value) }
|
||||
ticks: { precision: 0, callback: value => format(value) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ module github.com/seaweedfs/seaweedfs/telemetry/server
|
||||
go 1.25.8
|
||||
|
||||
require (
|
||||
github.com/prometheus/client_golang v1.24.0
|
||||
github.com/prometheus/client_golang v1.24.1
|
||||
github.com/seaweedfs/seaweedfs v0.0.0-00010101000000-000000000000
|
||||
google.golang.org/protobuf v1.36.11
|
||||
)
|
||||
@@ -13,7 +13,7 @@ require (
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.70.0 // indirect
|
||||
github.com/prometheus/common v0.70.1 // indirect
|
||||
github.com/prometheus/procfs v0.21.1 // indirect
|
||||
golang.org/x/sys v0.47.0 // indirect
|
||||
)
|
||||
|
||||
@@ -6,20 +6,20 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/klauspost/compress v1.19.0 h1:sXLILfc9jV2QYWkzFOPWStmcUVH2RHEB1JCdY2oVvCQ=
|
||||
github.com/klauspost/compress v1.19.0/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||
github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=
|
||||
github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.24.0 h1:5XStIklKuAtJSNpdD3s8XJj/Yv78IQmE1kbNk87JrAI=
|
||||
github.com/prometheus/client_golang v1.24.0/go.mod h1:QcsNdotprC2nS4BTM2ucbcqxd2CeXTEa9jW7zHO9iDE=
|
||||
github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU=
|
||||
github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE=
|
||||
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
||||
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
||||
github.com/prometheus/common v0.70.0 h1:bcpru3tWPVnxGnETLgOV5jbp/JRXgYEyv65CuBLAMMI=
|
||||
github.com/prometheus/common v0.70.0/go.mod h1:S/SFasQmgGiYH6C81LKCtYa8QACgthGg5zxL2udV7SY=
|
||||
github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi/PY=
|
||||
github.com/prometheus/common v0.70.1/go.mod h1:VdFUQDMZK3VLkurFUVhia6uys/0suUp86TJz5qbJRhc=
|
||||
github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI=
|
||||
github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
|
||||
@@ -80,8 +80,8 @@ func TestGetMetricsWindowStartsAtOldestSample(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// "Total Disk Usage Over Time" and the stacked "Cluster Sizes Over Time" sit on
|
||||
// the same dashboard, so their last day has to add up to the same number.
|
||||
// /api/metrics is the fleet total that /api/cluster-sizes breaks down per
|
||||
// cluster, so their last day has to add up to the same number.
|
||||
func TestGetMetricsAgreesWithClusterSizes(t *testing.T) {
|
||||
s := newPrometheusStorage(prometheus.NewRegistry())
|
||||
seedSamples(s, "daily", HistorySample{TotalDiskBytes: 300, VolumeServerCount: 3},
|
||||
|
||||
@@ -5,32 +5,38 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// ClusterSeries is one cluster's daily disk usage, aligned to the shared date
|
||||
// axis of the enclosing ClusterSizeSeries.
|
||||
// ClusterSeries is one cluster's daily disk usage and volume server count,
|
||||
// aligned to the shared date axis of the enclosing ClusterSizeSeries.
|
||||
type ClusterSeries struct {
|
||||
ClusterId string `json:"cluster_id"`
|
||||
Disk []uint64 `json:"disk"`
|
||||
Servers []uint64 `json:"servers"`
|
||||
}
|
||||
|
||||
// OtherSeries is the clusters beyond the caller's limit, summed per day so a
|
||||
// stacked chart still adds up to the fleet total.
|
||||
type OtherSeries struct {
|
||||
Count int `json:"count"`
|
||||
Disk []uint64 `json:"disk"`
|
||||
Count int `json:"count"`
|
||||
Disk []uint64 `json:"disk"`
|
||||
Servers []uint64 `json:"servers"`
|
||||
}
|
||||
|
||||
// ClusterSizeSeries is per-cluster disk usage over time: one value per cluster
|
||||
// per day, largest cluster first, ranked by their most recent day.
|
||||
// ClusterSizeSeries is per-cluster disk usage and volume server count over
|
||||
// time: one value per cluster per day, largest cluster first, ranked by disk on
|
||||
// their most recent day. Both metrics share one ranking so a cluster keeps its
|
||||
// place, and its colour, across the charts drawn from this.
|
||||
type ClusterSizeSeries struct {
|
||||
Dates []string `json:"dates"`
|
||||
Clusters []ClusterSeries `json:"clusters"`
|
||||
Other *OtherSeries `json:"other,omitempty"`
|
||||
ClusterCount int `json:"cluster_count"`
|
||||
TotalDisk uint64 `json:"total_disk"` // across all clusters on the last day
|
||||
TotalDisk uint64 `json:"total_disk"` // across all clusters on the last day
|
||||
TotalServers uint64 `json:"total_servers"` // across all clusters on the last day
|
||||
}
|
||||
|
||||
// GetClusterSizeSeries returns the last `days` days of per-cluster disk usage
|
||||
// across confirmed clusters. Clusters beyond `limit` are folded into Other.
|
||||
// and volume server counts across confirmed clusters. Clusters beyond `limit`
|
||||
// are folded into Other.
|
||||
func (s *PrometheusStorage) GetClusterSizeSeries(days, limit int) ClusterSizeSeries {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
@@ -46,8 +52,10 @@ func (s *PrometheusStorage) GetClusterSizeSeries(days, limit int) ClusterSizeSer
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
series.Clusters = append(series.Clusters, ClusterSeries{ClusterId: id, Disk: disk})
|
||||
servers, _ := axis.align(history, activeSince, serverCount)
|
||||
series.Clusters = append(series.Clusters, ClusterSeries{ClusterId: id, Disk: disk, Servers: servers})
|
||||
series.TotalDisk += disk[last]
|
||||
series.TotalServers += servers[last]
|
||||
}
|
||||
series.ClusterCount = len(series.Clusters)
|
||||
|
||||
@@ -63,13 +71,17 @@ func (s *PrometheusStorage) GetClusterSizeSeries(days, limit int) ClusterSizeSer
|
||||
|
||||
if limit > 0 && len(series.Clusters) > limit {
|
||||
other := OtherSeries{
|
||||
Count: len(series.Clusters) - limit,
|
||||
Disk: make([]uint64, len(axis.dates)),
|
||||
Count: len(series.Clusters) - limit,
|
||||
Disk: make([]uint64, len(axis.dates)),
|
||||
Servers: make([]uint64, len(axis.dates)),
|
||||
}
|
||||
for _, c := range series.Clusters[limit:] {
|
||||
for i, v := range c.Disk {
|
||||
other.Disk[i] += v
|
||||
}
|
||||
for i, v := range c.Servers {
|
||||
other.Servers[i] += v
|
||||
}
|
||||
}
|
||||
series.Clusters = series.Clusters[:limit]
|
||||
series.Other = &other
|
||||
|
||||
@@ -8,12 +8,7 @@ import (
|
||||
"github.com/seaweedfs/seaweedfs/telemetry/proto"
|
||||
)
|
||||
|
||||
// seedHistory gives a cluster one sample per listed day offset (0 is today).
|
||||
func seedHistory(s *PrometheusStorage, id string, disk uint64, dayOffsets ...int) {
|
||||
seedSamples(s, id, HistorySample{TotalDiskBytes: disk}, dayOffsets...)
|
||||
}
|
||||
|
||||
// seedSamples is seedHistory for tests that care about more than disk usage.
|
||||
// seedSamples gives a cluster one sample per listed day offset (0 is today).
|
||||
// The sample's Ts is filled in per day offset.
|
||||
func seedSamples(s *PrometheusStorage, id string, sample HistorySample, dayOffsets ...int) {
|
||||
s.mu.Lock()
|
||||
@@ -28,14 +23,15 @@ func TestClusterSizeSeries(t *testing.T) {
|
||||
s := newPrometheusStorage(prometheus.NewRegistry())
|
||||
|
||||
// Reported every day of the window.
|
||||
seedHistory(s, "daily", 300, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0)
|
||||
seedSamples(s, "daily", HistorySample{TotalDiskBytes: 300, VolumeServerCount: 3},
|
||||
-9, -8, -7, -6, -5, -4, -3, -2, -1, 0)
|
||||
// Reported two days ago and not since: still active, so its size is held
|
||||
// to the right edge instead of dropping out of the stack.
|
||||
seedHistory(s, "lagging", 200, -3, -2)
|
||||
seedSamples(s, "lagging", HistorySample{TotalDiskBytes: 200, VolumeServerCount: 2}, -3, -2)
|
||||
// Stopped reporting past the active window: its own days only.
|
||||
seedHistory(s, "gone", 900, -9, -8)
|
||||
seedSamples(s, "gone", HistorySample{TotalDiskBytes: 900, VolumeServerCount: 9}, -9, -8)
|
||||
// One day of history only: unconfirmed, so it stays out of the stack.
|
||||
seedHistory(s, "oneshot", 400, -1)
|
||||
seedSamples(s, "oneshot", HistorySample{TotalDiskBytes: 400, VolumeServerCount: 4}, -1)
|
||||
|
||||
series := s.GetClusterSizeSeries(10, 0)
|
||||
if len(series.Dates) != 10 {
|
||||
@@ -45,27 +41,41 @@ func TestClusterSizeSeries(t *testing.T) {
|
||||
t.Fatalf("cluster_count = %d, want 3", series.ClusterCount)
|
||||
}
|
||||
|
||||
byId := map[string][]uint64{}
|
||||
byId := map[string]ClusterSeries{}
|
||||
for _, c := range series.Clusters {
|
||||
byId[c.ClusterId] = c.Disk
|
||||
byId[c.ClusterId] = c
|
||||
}
|
||||
if got := byId["daily"]; !equal(got, []uint64{300, 300, 300, 300, 300, 300, 300, 300, 300, 300}) {
|
||||
if got := byId["daily"].Disk; !equal(got, []uint64{300, 300, 300, 300, 300, 300, 300, 300, 300, 300}) {
|
||||
t.Errorf("daily = %v, want 300 every day", got)
|
||||
}
|
||||
if got := byId["lagging"]; !equal(got, []uint64{0, 0, 0, 0, 0, 0, 200, 200, 200, 200}) {
|
||||
if got := byId["lagging"].Disk; !equal(got, []uint64{0, 0, 0, 0, 0, 0, 200, 200, 200, 200}) {
|
||||
t.Errorf("lagging = %v, want its size carried to the right edge", got)
|
||||
}
|
||||
if got := byId["gone"]; !equal(got, []uint64{900, 900, 0, 0, 0, 0, 0, 0, 0, 0}) {
|
||||
if got := byId["gone"].Disk; !equal(got, []uint64{900, 900, 0, 0, 0, 0, 0, 0, 0, 0}) {
|
||||
t.Errorf("gone = %v, want no capacity after its last report", got)
|
||||
}
|
||||
if _, ok := byId["oneshot"]; ok {
|
||||
t.Errorf("unconfirmed cluster in the stack: %v", byId["oneshot"])
|
||||
t.Errorf("unconfirmed cluster in the stack: %+v", byId["oneshot"])
|
||||
}
|
||||
|
||||
// The total is the last day's stack height: daily + lagging, not gone.
|
||||
// Volume servers ride the same axis and the same hold-forward rule.
|
||||
if got := byId["daily"].Servers; !equal(got, []uint64{3, 3, 3, 3, 3, 3, 3, 3, 3, 3}) {
|
||||
t.Errorf("daily servers = %v, want 3 every day", got)
|
||||
}
|
||||
if got := byId["lagging"].Servers; !equal(got, []uint64{0, 0, 0, 0, 0, 0, 2, 2, 2, 2}) {
|
||||
t.Errorf("lagging servers = %v, want carried to the right edge", got)
|
||||
}
|
||||
if got := byId["gone"].Servers; !equal(got, []uint64{9, 9, 0, 0, 0, 0, 0, 0, 0, 0}) {
|
||||
t.Errorf("gone servers = %v, want none after its last report", got)
|
||||
}
|
||||
|
||||
// The totals are the last day's stack height: daily + lagging, not gone.
|
||||
if series.TotalDisk != 500 {
|
||||
t.Errorf("total_disk = %d, want 500", series.TotalDisk)
|
||||
}
|
||||
if series.TotalServers != 5 {
|
||||
t.Errorf("total_servers = %d, want 5", series.TotalServers)
|
||||
}
|
||||
// Largest on the last day comes first so the stack reads top-down.
|
||||
if series.Clusters[0].ClusterId != "daily" {
|
||||
t.Errorf("order = %s first, want daily", series.Clusters[0].ClusterId)
|
||||
@@ -82,8 +92,12 @@ func TestClusterSizeSeries(t *testing.T) {
|
||||
if !equal(series.Other.Disk, []uint64{900, 900, 0, 0, 0, 0, 200, 200, 200, 200}) {
|
||||
t.Errorf("other = %v, want lagging+gone summed per day", series.Other.Disk)
|
||||
}
|
||||
if series.ClusterCount != 3 || series.TotalDisk != 500 {
|
||||
t.Errorf("limit changed totals: count=%d disk=%d, want 3/500", series.ClusterCount, series.TotalDisk)
|
||||
if !equal(series.Other.Servers, []uint64{9, 9, 0, 0, 0, 0, 2, 2, 2, 2}) {
|
||||
t.Errorf("other servers = %v, want lagging+gone summed per day", series.Other.Servers)
|
||||
}
|
||||
if series.ClusterCount != 3 || series.TotalDisk != 500 || series.TotalServers != 5 {
|
||||
t.Errorf("limit changed totals: count=%d disk=%d servers=%d, want 3/500/5",
|
||||
series.ClusterCount, series.TotalDisk, series.TotalServers)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,15 +107,17 @@ func TestClusterSizeSeriesUsesLatestDailySample(t *testing.T) {
|
||||
s := newPrometheusStorage(prometheus.NewRegistry())
|
||||
|
||||
data := &proto.TelemetryData{
|
||||
TopologyId: "aaaaaaaa-0000-0000-0000-000000000001",
|
||||
Version: "4.40",
|
||||
Os: "linux/amd64",
|
||||
TotalDiskBytes: 100,
|
||||
TopologyId: "aaaaaaaa-0000-0000-0000-000000000001",
|
||||
Version: "4.40",
|
||||
Os: "linux/amd64",
|
||||
TotalDiskBytes: 100,
|
||||
VolumeServerCount: 4,
|
||||
}
|
||||
if err := s.StoreTelemetry(data); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
data.TotalDiskBytes = 700
|
||||
data.VolumeServerCount = 6
|
||||
if err := s.StoreTelemetry(data); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -118,8 +134,11 @@ func TestClusterSizeSeriesUsesLatestDailySample(t *testing.T) {
|
||||
if got := series.Clusters[0].Disk; !equal(got, []uint64{700}) {
|
||||
t.Errorf("disk = %v, want today's latest sample only", got)
|
||||
}
|
||||
if series.TotalDisk != 700 {
|
||||
t.Errorf("total_disk = %d, want 700", series.TotalDisk)
|
||||
if got := series.Clusters[0].Servers; !equal(got, []uint64{6}) {
|
||||
t.Errorf("servers = %v, want today's latest sample only", got)
|
||||
}
|
||||
if series.TotalDisk != 700 || series.TotalServers != 6 {
|
||||
t.Errorf("totals = %d disk / %d servers, want 700/6", series.TotalDisk, series.TotalServers)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package acl
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func createOwnershipTestBucket(t *testing.T, client *s3.Client) string {
|
||||
bucketName := "test-ownership-" + strings.ToLower(strings.ReplaceAll(time.Now().Format("2006-01-02-15-04-05.000"), ":", "-"))
|
||||
_, err := client.CreateBucket(context.TODO(), &s3.CreateBucketInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
return bucketName
|
||||
}
|
||||
|
||||
func getObjectOwnership(t *testing.T, client *s3.Client, bucketName string) types.ObjectOwnership {
|
||||
t.Helper()
|
||||
resp, err := client.GetBucketOwnershipControls(context.TODO(), &s3.GetBucketOwnershipControlsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, resp.OwnershipControls)
|
||||
require.Len(t, resp.OwnershipControls.Rules, 1)
|
||||
return resp.OwnershipControls.Rules[0].ObjectOwnership
|
||||
}
|
||||
|
||||
func putObjectOwnership(t *testing.T, client *s3.Client, bucketName string, ownership types.ObjectOwnership) {
|
||||
t.Helper()
|
||||
_, err := client.PutBucketOwnershipControls(context.TODO(), &s3.PutBucketOwnershipControlsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
OwnershipControls: &types.OwnershipControls{
|
||||
Rules: []types.OwnershipControlsRule{{ObjectOwnership: ownership}},
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestGetBucketOwnershipControlsDefault(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := createOwnershipTestBucket(t, client)
|
||||
defer cleanupTestBucket(t, client, bucketName)
|
||||
|
||||
assert.Equal(t, types.ObjectOwnershipBucketOwnerEnforced, getObjectOwnership(t, client, bucketName))
|
||||
}
|
||||
|
||||
func TestBucketOwnershipControlsLifecycle(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := createOwnershipTestBucket(t, client)
|
||||
defer cleanupTestBucket(t, client, bucketName)
|
||||
|
||||
putObjectOwnership(t, client, bucketName, types.ObjectOwnershipObjectWriter)
|
||||
assert.Equal(t, types.ObjectOwnershipObjectWriter, getObjectOwnership(t, client, bucketName))
|
||||
|
||||
putObjectOwnership(t, client, bucketName, types.ObjectOwnershipBucketOwnerEnforced)
|
||||
assert.Equal(t, types.ObjectOwnershipBucketOwnerEnforced, getObjectOwnership(t, client, bucketName))
|
||||
|
||||
_, err := client.DeleteBucketOwnershipControls(context.TODO(), &s3.DeleteBucketOwnershipControlsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, types.ObjectOwnershipBucketOwnerEnforced, getObjectOwnership(t, client, bucketName))
|
||||
}
|
||||
|
||||
// A bucket with nothing stored already reports BucketOwnerEnforced, so this put has
|
||||
// to persist anyway or the delete below finds nothing to remove.
|
||||
func TestPutBucketOwnershipControlsDefaultOnNewBucket(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := createOwnershipTestBucket(t, client)
|
||||
defer cleanupTestBucket(t, client, bucketName)
|
||||
|
||||
putObjectOwnership(t, client, bucketName, types.ObjectOwnershipBucketOwnerEnforced)
|
||||
|
||||
_, err := client.DeleteBucketOwnershipControls(context.TODO(), &s3.DeleteBucketOwnershipControlsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = client.DeleteBucketOwnershipControls(context.TODO(), &s3.DeleteBucketOwnershipControlsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
})
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "OwnershipControlsNotFound")
|
||||
}
|
||||
@@ -36,12 +36,65 @@ func TestLifecycleAdminDispatchSucceedsWithCustomFilerGrpcPort(t *testing.T) {
|
||||
|
||||
waitForLifecycleWorkerReady(t, adminEndpoint)
|
||||
|
||||
// Lifecycle is a long-running batch; the run endpoint cancels it at
|
||||
// this timeout, which converts a healthy run into canceled_count=1.
|
||||
const runTimeoutSeconds = 30
|
||||
body, err := json.Marshal(map[string]any{
|
||||
"timeout_seconds": runTimeoutSeconds,
|
||||
})
|
||||
payload := runLifecycleJob(t, adminEndpoint, 30)
|
||||
|
||||
require.GreaterOrEqual(t, jsonNumber(t, payload, "detected_count"), 1)
|
||||
require.Equal(t, 0, jsonNumber(t, payload, "error_count"),
|
||||
"dispatched job errored — likely filer_grpc_address was raw host:httpPort.grpcPort")
|
||||
|
||||
require.Eventuallyf(t, func() bool {
|
||||
_, err := c.HeadObject(context.Background(), &s3.HeadObjectInput{
|
||||
Bucket: aws.String(bucket), Key: aws.String(oldKey),
|
||||
})
|
||||
return err != nil
|
||||
}, 30*time.Second, 500*time.Millisecond,
|
||||
"expected %s/%s to be deleted after admin-dispatched lifecycle run", bucket, oldKey)
|
||||
}
|
||||
|
||||
// A worker-dispatched pass with rules in place but nothing due: the
|
||||
// invariant is that a pass returns on its own, so the admin never has to
|
||||
// cancel it and the executor slot is free for the next one.
|
||||
//
|
||||
// Not a regression test for the wedge this scenario comes from. Before
|
||||
// the subscription was bounded a pass ended only when some write landed
|
||||
// past its boundary, and on a shared test cluster something usually
|
||||
// does — verified: the whole suite passes on the unfixed build. The
|
||||
// deterministic guards are the dailyrun unit tests. This covers the
|
||||
// worker path end-to-end and would catch a pass that hangs
|
||||
// unconditionally.
|
||||
func TestLifecycleAdminDispatchCompletesWithNothingDue(t *testing.T) {
|
||||
adminEndpoint := envOr("ADMIN_ENDPOINT", defaultAdminEndpoint)
|
||||
|
||||
c := s3Client(t)
|
||||
bucket := uniqueBucket("admin-idle")
|
||||
mustCreateBucket(t, c, bucket)
|
||||
putExpirationLifecycle(t, c, bucket, "expire/", 1)
|
||||
// Deliberately not backdated: the rule matches the prefix but nothing
|
||||
// is due, so the pass dispatches nothing.
|
||||
putObject(t, c, bucket, "expire/fresh.txt", "fresh")
|
||||
|
||||
waitForLifecycleWorkerReady(t, adminEndpoint)
|
||||
|
||||
// Let the writes above settle below the pass boundary, or one of them
|
||||
// ends the pass and the wedge is masked.
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
payload := runLifecycleJob(t, adminEndpoint, 30)
|
||||
|
||||
require.Equal(t, 0, jsonNumber(t, payload, "canceled_count"),
|
||||
"pass did not return on its own; the admin cancelled it at the run timeout")
|
||||
require.GreaterOrEqual(t, jsonNumber(t, payload, "success_count"), 1,
|
||||
"expected the dispatched pass to complete")
|
||||
require.Equal(t, 0, jsonNumber(t, payload, "skipped_active_count"),
|
||||
"a previous pass still held the executor slot")
|
||||
}
|
||||
|
||||
// runLifecycleJob drives the admin's run endpoint and returns its decoded
|
||||
// response. timeoutSeconds bounds the run admin-side: a pass that never
|
||||
// returns comes back as canceled_count=1 after that long.
|
||||
func runLifecycleJob(t *testing.T, adminEndpoint string, timeoutSeconds int) map[string]any {
|
||||
t.Helper()
|
||||
body, err := json.Marshal(map[string]any{"timeout_seconds": timeoutSeconds})
|
||||
require.NoError(t, err)
|
||||
req, err := http.NewRequestWithContext(
|
||||
context.Background(), http.MethodPost,
|
||||
@@ -59,18 +112,7 @@ func TestLifecycleAdminDispatchSucceedsWithCustomFilerGrpcPort(t *testing.T) {
|
||||
require.NoError(t, json.NewDecoder(resp.Body).Decode(&payload))
|
||||
t.Logf("admin /api/plugin/job-types/s3_lifecycle/run response: %v", payload)
|
||||
require.Equal(t, http.StatusOK, resp.StatusCode, "admin run endpoint failed: %v", payload)
|
||||
|
||||
require.GreaterOrEqual(t, jsonNumber(t, payload, "detected_count"), 1)
|
||||
require.Equal(t, 0, jsonNumber(t, payload, "error_count"),
|
||||
"dispatched job errored — likely filer_grpc_address was raw host:httpPort.grpcPort")
|
||||
|
||||
require.Eventuallyf(t, func() bool {
|
||||
_, err := c.HeadObject(context.Background(), &s3.HeadObjectInput{
|
||||
Bucket: aws.String(bucket), Key: aws.String(oldKey),
|
||||
})
|
||||
return err != nil
|
||||
}, 30*time.Second, 500*time.Millisecond,
|
||||
"expected %s/%s to be deleted after admin-dispatched lifecycle run", bucket, oldKey)
|
||||
return payload
|
||||
}
|
||||
|
||||
func jsonNumber(t *testing.T, payload map[string]any, key string) int {
|
||||
|
||||
@@ -6,8 +6,11 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
@@ -31,6 +34,152 @@ func suspendVersioning(t *testing.T, client *s3.Client, bucketName string) {
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
// vacuumVolumes asks the master to compact away the needles a delete tombstoned.
|
||||
// Tests that assert a surviving object still has its data need this: deleting an
|
||||
// entry only tombstones the needles it points at, so a shared chunk list reads
|
||||
// fine right up until the vacuum makes the loss permanent. A vacuum that does not
|
||||
// run leaves those tests asserting nothing, so treat every failure as fatal.
|
||||
func vacuumVolumes(t *testing.T) {
|
||||
t.Helper()
|
||||
require.NotEmpty(t, defaultConfig.MasterEndpoint, "vacuum needs a master endpoint; set MASTER_ENDPOINT")
|
||||
endpoint := strings.TrimRight(defaultConfig.MasterEndpoint, "/") + "/vol/vacuum?garbageThreshold=0.001"
|
||||
httpClient := &http.Client{Timeout: 30 * time.Second}
|
||||
resp, err := httpClient.Get(endpoint)
|
||||
require.NoError(t, err, "vacuum request to %s", endpoint)
|
||||
defer resp.Body.Close()
|
||||
_, err = io.Copy(io.Discard, resp.Body)
|
||||
require.NoError(t, err, "reading the vacuum response")
|
||||
require.Equal(t, http.StatusOK, resp.StatusCode, "vacuum request to %s", endpoint)
|
||||
}
|
||||
|
||||
func requireVersionBody(t *testing.T, client *s3.Client, bucketName, objectKey, versionId string, want []byte, msg string) {
|
||||
t.Helper()
|
||||
getResp, err := client.GetObject(context.TODO(), &s3.GetObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
VersionId: aws.String(versionId),
|
||||
})
|
||||
require.NoError(t, err, msg)
|
||||
defer getResp.Body.Close()
|
||||
body, err := io.ReadAll(getResp.Body)
|
||||
require.NoError(t, err, msg)
|
||||
require.Equal(t, len(want), len(body), msg)
|
||||
require.True(t, bytes.Equal(want, body), msg)
|
||||
}
|
||||
|
||||
// chunkedTestContent returns a body large enough to land in volume needles rather
|
||||
// than inline in the filer entry, so a copy that reuses the source fids is visible
|
||||
// once those needles are freed.
|
||||
func chunkedTestContent(size int) []byte {
|
||||
content := make([]byte, size)
|
||||
for i := range content {
|
||||
content[i] = byte(i * 31 % 251)
|
||||
}
|
||||
return content
|
||||
}
|
||||
|
||||
// TestVersioningSelfCopyMetadataReplaceKeepsChunksIndependent covers the copy that
|
||||
// only rewrites metadata: it used to hand the source version's chunk fids to the
|
||||
// new version, so nothing owned those needles and deleting either version freed
|
||||
// the survivor's data (silently, once a vacuum ran).
|
||||
func TestVersioningSelfCopyMetadataReplaceKeepsChunksIndependent(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
|
||||
enableVersioning(t, client, bucketName)
|
||||
|
||||
objectKey := "self-copy-chunk-ownership.bin"
|
||||
content := chunkedTestContent(6 << 20)
|
||||
|
||||
putResp, err := client.PutObject(context.TODO(), &s3.PutObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
Body: bytes.NewReader(content),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, putResp.VersionId)
|
||||
|
||||
copyResp, err := client.CopyObject(context.TODO(), &s3.CopyObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
CopySource: aws.String(versioningCopySource(bucketName, objectKey)),
|
||||
Metadata: map[string]string{"mtime": "1653465360"},
|
||||
MetadataDirective: types.MetadataDirectiveReplace,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, copyResp.VersionId)
|
||||
require.NotEqual(t, *putResp.VersionId, *copyResp.VersionId)
|
||||
|
||||
_, err = client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
VersionId: putResp.VersionId,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
// The filer frees a deleted entry's chunks asynchronously, so re-check across
|
||||
// a few vacuum rounds instead of racing a single one.
|
||||
for round := 0; round < 4; round++ {
|
||||
time.Sleep(time.Second)
|
||||
vacuumVolumes(t)
|
||||
requireVersionBody(t, client, bucketName, objectKey, *copyResp.VersionId, content,
|
||||
"the surviving version must keep its own data after the other version is deleted")
|
||||
}
|
||||
}
|
||||
|
||||
// TestSuspendedSelfCopyMetadataReplaceKeepsChunksIndependent is the same defect on
|
||||
// a suspended bucket: the null version the copy writes sits beside a .versions/
|
||||
// entry that stays live, so the two must not share needles either.
|
||||
func TestSuspendedSelfCopyMetadataReplaceKeepsChunksIndependent(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
|
||||
enableVersioning(t, client, bucketName)
|
||||
|
||||
objectKey := "suspended-self-copy-chunk-ownership.bin"
|
||||
content := chunkedTestContent(6 << 20)
|
||||
|
||||
putResp, err := client.PutObject(context.TODO(), &s3.PutObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
Body: bytes.NewReader(content),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, putResp.VersionId)
|
||||
|
||||
suspendVersioning(t, client, bucketName)
|
||||
|
||||
_, err = client.CopyObject(context.TODO(), &s3.CopyObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
CopySource: aws.String(versioningCopySource(bucketName, objectKey)),
|
||||
Metadata: map[string]string{"mtime": "1653465360"},
|
||||
MetadataDirective: types.MetadataDirectiveReplace,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
// Drop the version the copy read from; the null version it wrote must survive.
|
||||
_, err = client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
VersionId: putResp.VersionId,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
for round := 0; round < 4; round++ {
|
||||
time.Sleep(time.Second)
|
||||
vacuumVolumes(t)
|
||||
requireVersionBody(t, client, bucketName, objectKey, "null", content,
|
||||
"the null version must keep its own data after the version it was copied from is deleted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVersioningSelfCopyMetadataReplaceCreatesNewVersion(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
@@ -250,3 +399,59 @@ func TestSelfCopyWithSuspendedVersioningIsRejected(t *testing.T) {
|
||||
assert.Equal(t, "InvalidRequest", apiErr.ErrorCode())
|
||||
}
|
||||
}
|
||||
|
||||
// A suspended-versioning CopyObject writes the null version at the regular path, so
|
||||
// like PutObject and multipart completion it has to retire the null delete marker a
|
||||
// preceding DELETE left in .versions. While the regular-path object owns the null
|
||||
// slot the leftover marker is shadowed, but it resurfaces as a phantom delete the
|
||||
// moment that null version goes away.
|
||||
func TestSuspendedCopyRetiresDeleteMarker(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
|
||||
sourceKey := "suspended-copy-source.txt"
|
||||
objectKey := "suspended-copy-dest.txt"
|
||||
|
||||
enableVersioning(t, client, bucketName)
|
||||
putObject(t, client, bucketName, objectKey, "pre-suspension-content")
|
||||
suspendVersioning(t, client, bucketName)
|
||||
|
||||
putObject(t, client, bucketName, sourceKey, "source-content")
|
||||
putObject(t, client, bucketName, objectKey, "null-version-content")
|
||||
deleteKey(t, client, bucketName, objectKey)
|
||||
|
||||
_, err := client.CopyObject(context.TODO(), &s3.CopyObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
CopySource: aws.String(versioningCopySource(bucketName, sourceKey)),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
getResp, err := client.GetObject(context.TODO(), &s3.GetObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
defer getResp.Body.Close()
|
||||
body, err := io.ReadAll(getResp.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "source-content", string(body))
|
||||
|
||||
// Drop the null version the copy just wrote; a retired marker leaves nothing behind.
|
||||
_, err = client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
VersionId: aws.String("null"),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
listResp, err := client.ListObjectVersions(context.TODO(), &s3.ListObjectVersionsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Prefix: aws.String(objectKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Empty(t, listResp.DeleteMarkers, "the copy should have retired the null delete marker")
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
package s3api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
"github.com/aws/smithy-go"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestDeletedDirectoryMarkerDisappears covers the rclone directory_markers flow: a key
|
||||
// created with PutObject on "m2/" is deleted, and stops being a key everywhere. The
|
||||
// directory that carried it goes with it once nothing is left underneath.
|
||||
func TestDeletedDirectoryMarkerDisappears(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
enableVersioning(t, client, bucketName)
|
||||
|
||||
putObject(t, client, bucketName, "m2/", "")
|
||||
putObject(t, client, bucketName, "m2/f.txt", "hi")
|
||||
assert.Equal(t, []string{"m2/", "m2/f.txt"}, listKeys(t, client, bucketName, ""))
|
||||
|
||||
deleteKey(t, client, bucketName, "m2/f.txt")
|
||||
deleteKey(t, client, bucketName, "m2/")
|
||||
|
||||
assert.Empty(t, listKeys(t, client, bucketName, ""), "the deleted marker is not a key")
|
||||
assert.Empty(t, listPrefixes(t, client, bucketName, ""), "and it names no prefix")
|
||||
|
||||
// The file's own version history is untouched by deleting the directory key.
|
||||
versions, err := client.ListObjectVersions(context.TODO(), &s3.ListObjectVersionsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
for _, v := range versions.Versions {
|
||||
assert.NotEqual(t, "m2/", *v.Key, "a directory marker is not a versioned object")
|
||||
}
|
||||
for _, m := range versions.DeleteMarkers {
|
||||
assert.NotEqual(t, "m2/", *m.Key, "deleting one writes no delete marker")
|
||||
}
|
||||
assert.Len(t, versions.Versions, 1, "m2/f.txt keeps its version")
|
||||
assert.Len(t, versions.DeleteMarkers, 1, "and its delete marker")
|
||||
|
||||
// Re-creating the marker brings the key back.
|
||||
putObject(t, client, bucketName, "m2/", "")
|
||||
assert.Equal(t, []string{"m2/"}, listKeys(t, client, bucketName, ""))
|
||||
_, err = client.HeadObject(context.TODO(), &s3.HeadObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String("m2/"),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
// TestDeletedDirectoryMarkerKeepsItsSubtree pins the boundary: deleting the key "m2/"
|
||||
// says nothing about the objects under it, which keep listing and keep the prefix.
|
||||
func TestDeletedDirectoryMarkerKeepsItsSubtree(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
enableVersioning(t, client, bucketName)
|
||||
|
||||
putObject(t, client, bucketName, "m2/", "")
|
||||
putObject(t, client, bucketName, "m2/keep.txt", "still here")
|
||||
|
||||
deleteKey(t, client, bucketName, "m2/")
|
||||
|
||||
assert.Equal(t, []string{"m2/keep.txt"}, listKeys(t, client, bucketName, ""), "the marker key is gone")
|
||||
assert.Equal(t, []string{"m2/"}, listPrefixes(t, client, bucketName, ""),
|
||||
"a live child keeps the prefix")
|
||||
assert.Equal(t, []string{"m2/keep.txt"}, listKeys(t, client, bucketName, "m2/"))
|
||||
|
||||
// The surviving object is still readable through the prefix that no longer has a key.
|
||||
got, err := client.GetObject(context.TODO(), &s3.GetObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String("m2/keep.txt"),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, got.Body.Close())
|
||||
}
|
||||
|
||||
// TestDeletedDirectoryMarkerIsGoneFromReads checks the read surfaces once nothing is
|
||||
// left under the deleted key: the directory goes with it, so the path is not there.
|
||||
func TestDeletedDirectoryMarkerIsGoneFromReads(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
enableVersioning(t, client, bucketName)
|
||||
|
||||
putObject(t, client, bucketName, "m2/", "")
|
||||
deleteKey(t, client, bucketName, "m2/")
|
||||
|
||||
_, err := client.HeadObject(context.TODO(), &s3.HeadObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String("m2/"),
|
||||
})
|
||||
require.Error(t, err, "HEAD on a deleted directory marker must not answer 200")
|
||||
_, err = client.GetObject(context.TODO(), &s3.GetObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String("m2/"),
|
||||
})
|
||||
requireAPIError(t, err, "NoSuchKey")
|
||||
assert.Empty(t, listKeys(t, client, bucketName, "m2/"))
|
||||
}
|
||||
|
||||
// TestDirectoryMarkerDeleteMatchesUnversioned pins the point of the change: a directory
|
||||
// marker is deleted the same way whether or not the bucket is versioned.
|
||||
func TestDirectoryMarkerDeleteMatchesUnversioned(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
|
||||
for _, versioned := range []bool{false, true} {
|
||||
bucketName := getNewBucketName()
|
||||
createBucket(t, client, bucketName)
|
||||
if versioned {
|
||||
enableVersioning(t, client, bucketName)
|
||||
}
|
||||
|
||||
putObject(t, client, bucketName, "m/", "")
|
||||
putObject(t, client, bucketName, "m/child.txt", "x")
|
||||
deleteKey(t, client, bucketName, "m/")
|
||||
|
||||
assert.Equal(t, []string{"m/child.txt"}, listKeys(t, client, bucketName, ""),
|
||||
"versioned=%v: the marker key is gone, the child stays", versioned)
|
||||
assert.Equal(t, []string{"m/"}, listPrefixes(t, client, bucketName, ""),
|
||||
"versioned=%v: the prefix survives its live child", versioned)
|
||||
|
||||
deleteBucket(t, client, bucketName)
|
||||
}
|
||||
}
|
||||
|
||||
// TestDeleteDirectoryMarkerSparesAPromotedFile guards the sharp edge of storing a key
|
||||
// on a directory entry: writing under an existing object turns that object's entry into
|
||||
// a directory while it keeps its data, so "m2/" and "m2" end up on the same entry. They
|
||||
// are still different keys, and deleting one must not destroy the other.
|
||||
func TestDeleteDirectoryMarkerSparesAPromotedFile(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
|
||||
for _, versioned := range []bool{false, true} {
|
||||
bucketName := getNewBucketName()
|
||||
createBucket(t, client, bucketName)
|
||||
|
||||
putObject(t, client, bucketName, "m2", "important data")
|
||||
if versioned {
|
||||
enableVersioning(t, client, bucketName)
|
||||
}
|
||||
putObject(t, client, bucketName, "m2/child.txt", "child")
|
||||
|
||||
deleteKey(t, client, bucketName, "m2/")
|
||||
|
||||
got, err := client.GetObject(context.TODO(), &s3.GetObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String("m2"),
|
||||
})
|
||||
require.NoError(t, err, "versioned=%v: deleting m2/ must not delete m2", versioned)
|
||||
body, err := io.ReadAll(got.Body)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, got.Body.Close())
|
||||
assert.Equal(t, "important data", string(body), "versioned=%v", versioned)
|
||||
|
||||
deleteBucket(t, client, bucketName)
|
||||
}
|
||||
}
|
||||
|
||||
func listObjects(t *testing.T, client *s3.Client, bucketName, prefix, delimiter string) *s3.ListObjectsV2Output {
|
||||
t.Helper()
|
||||
input := &s3.ListObjectsV2Input{Bucket: aws.String(bucketName)}
|
||||
if prefix != "" {
|
||||
input.Prefix = aws.String(prefix)
|
||||
}
|
||||
if delimiter != "" {
|
||||
input.Delimiter = aws.String(delimiter)
|
||||
}
|
||||
resp, err := client.ListObjectsV2(context.TODO(), input)
|
||||
require.NoError(t, err)
|
||||
return resp
|
||||
}
|
||||
|
||||
// listKeys lists without a delimiter, so a directory marker shows as the key it is
|
||||
// instead of rolling up into its own CommonPrefix.
|
||||
func listKeys(t *testing.T, client *s3.Client, bucketName, prefix string) []string {
|
||||
t.Helper()
|
||||
resp := listObjects(t, client, bucketName, prefix, "")
|
||||
keys := make([]string, 0, len(resp.Contents))
|
||||
for _, c := range resp.Contents {
|
||||
keys = append(keys, *c.Key)
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
func listPrefixes(t *testing.T, client *s3.Client, bucketName, prefix string) []string {
|
||||
t.Helper()
|
||||
resp := listObjects(t, client, bucketName, prefix, "/")
|
||||
prefixes := make([]string, 0, len(resp.CommonPrefixes))
|
||||
for _, p := range resp.CommonPrefixes {
|
||||
prefixes = append(prefixes, *p.Prefix)
|
||||
}
|
||||
return prefixes
|
||||
}
|
||||
|
||||
func deleteKey(t *testing.T, client *s3.Client, bucketName, key string) {
|
||||
t.Helper()
|
||||
_, err := client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(key),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func requireAPIError(t *testing.T, err error, code string) {
|
||||
t.Helper()
|
||||
require.Error(t, err)
|
||||
var apiErr smithy.APIError
|
||||
require.ErrorAs(t, err, &apiErr)
|
||||
assert.Equal(t, code, apiErr.ErrorCode())
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -80,3 +81,93 @@ func TestSuspendedDeleteCreatesDeleteMarker(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "versioned-content", string(body))
|
||||
}
|
||||
|
||||
// A suspended-versioning completion must drop the null delete marker a preceding
|
||||
// DELETE left in .versions, or it reports 200 and the object lists while HEAD/GET
|
||||
// keep resolving the marker and answer NoSuchKey.
|
||||
func TestSuspendedMultipartOverwritesDeleteMarker(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
|
||||
objectKey := "suspended-multipart-after-delete.bin"
|
||||
partData := bytes.Repeat([]byte("a"), 5*1024*1024)
|
||||
|
||||
// The cleanup retires only the null version, never the key's real history.
|
||||
enableVersioning(t, client, bucketName)
|
||||
realVersion := putObject(t, client, bucketName, objectKey, "pre-suspension-content")
|
||||
require.NotNil(t, realVersion.VersionId)
|
||||
suspendVersioning(t, client, bucketName)
|
||||
|
||||
completeSuspendedMultipart := func() {
|
||||
t.Helper()
|
||||
createResp, err := client.CreateMultipartUpload(context.TODO(), &s3.CreateMultipartUploadInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
uploadResp, err := client.UploadPart(context.TODO(), &s3.UploadPartInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
UploadId: createResp.UploadId,
|
||||
PartNumber: aws.Int32(1),
|
||||
Body: bytes.NewReader(partData),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = client.CompleteMultipartUpload(context.TODO(), &s3.CompleteMultipartUploadInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
UploadId: createResp.UploadId,
|
||||
MultipartUpload: &types.CompletedMultipartUpload{
|
||||
Parts: []types.CompletedPart{{ETag: uploadResp.ETag, PartNumber: aws.Int32(1)}},
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
completeSuspendedMultipart()
|
||||
deleteKey(t, client, bucketName, objectKey)
|
||||
completeSuspendedMultipart()
|
||||
|
||||
headResp := headObject(t, client, bucketName, objectKey)
|
||||
require.NotNil(t, headResp.ContentLength)
|
||||
assert.Equal(t, int64(len(partData)), *headResp.ContentLength)
|
||||
|
||||
getResp, err := client.GetObject(context.TODO(), &s3.GetObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
defer getResp.Body.Close()
|
||||
written, err := io.Copy(io.Discard, getResp.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, int64(len(partData)), written)
|
||||
|
||||
listResp, err := client.ListObjectVersions(context.TODO(), &s3.ListObjectVersionsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Prefix: aws.String(objectKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Empty(t, listResp.DeleteMarkers)
|
||||
|
||||
var listedVersionIds []string
|
||||
for _, version := range listResp.Versions {
|
||||
listedVersionIds = append(listedVersionIds, aws.ToString(version.VersionId))
|
||||
}
|
||||
assert.ElementsMatch(t, []string{*realVersion.VersionId, "null"}, listedVersionIds)
|
||||
|
||||
realVersionResp, err := client.GetObject(context.TODO(), &s3.GetObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
VersionId: realVersion.VersionId,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
defer realVersionResp.Body.Close()
|
||||
realVersionBody, err := io.ReadAll(realVersionResp.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "pre-suspension-content", string(realVersionBody))
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestSuspendedVersioningNullOverwrite tests the scenario where:
|
||||
@@ -255,3 +257,41 @@ func TestEnabledVersioningReturnsVersionId(t *testing.T) {
|
||||
t.Logf(" Version %d: VersionId=%s, Size=%d, IsLatest=%v", i, *v.VersionId, v.Size, v.IsLatest)
|
||||
}
|
||||
}
|
||||
|
||||
// The suspended PUT retires the null delete marker a preceding DELETE left, the same
|
||||
// as the copy and multipart paths. While the regular-path object owns the null slot a
|
||||
// leftover marker is shadowed, so it only shows once that null version goes away.
|
||||
func TestSuspendedPutRetiresDeleteMarker(t *testing.T) {
|
||||
client := getS3Client(t)
|
||||
bucketName := getNewBucketName()
|
||||
|
||||
createBucket(t, client, bucketName)
|
||||
defer deleteBucket(t, client, bucketName)
|
||||
|
||||
objectKey := "suspended-put-after-delete.txt"
|
||||
|
||||
enableVersioning(t, client, bucketName)
|
||||
putObject(t, client, bucketName, objectKey, "pre-suspension-content")
|
||||
suspendVersioning(t, client, bucketName)
|
||||
|
||||
putObject(t, client, bucketName, objectKey, "null-version-content")
|
||||
deleteKey(t, client, bucketName, objectKey)
|
||||
putObject(t, client, bucketName, objectKey, "replacement-content")
|
||||
|
||||
headObject(t, client, bucketName, objectKey)
|
||||
|
||||
// Drop the null version just written; a retired marker leaves nothing behind.
|
||||
_, err := client.DeleteObject(context.TODO(), &s3.DeleteObjectInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Key: aws.String(objectKey),
|
||||
VersionId: aws.String("null"),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
listResp, err := client.ListObjectVersions(context.TODO(), &s3.ListObjectVersionsInput{
|
||||
Bucket: aws.String(bucketName),
|
||||
Prefix: aws.String(objectKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Empty(t, listResp.DeleteMarkers, "the suspended PUT should have retired the null delete marker")
|
||||
}
|
||||
@@ -38,6 +38,9 @@ type oauthTestEnv struct {
|
||||
weedCancel context.CancelFunc
|
||||
accessKey string
|
||||
secretKey string
|
||||
// s3ExternalURL, when set before start, is the S3 endpoint the catalog
|
||||
// advertises to clients in LoadTable FileIO config.
|
||||
s3ExternalURL string
|
||||
}
|
||||
|
||||
func newOAuthTestEnv(t *testing.T) *oauthTestEnv {
|
||||
@@ -108,7 +111,7 @@ func (env *oauthTestEnv) start(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
env.weedCancel = cancel
|
||||
|
||||
cmd := exec.CommandContext(ctx, env.weedBinary, "mini",
|
||||
args := []string{"mini",
|
||||
"-master.port", fmt.Sprintf("%d", env.masterPort),
|
||||
"-master.port.grpc", fmt.Sprintf("%d", env.masterGrpcPort),
|
||||
"-volume.port", fmt.Sprintf("%d", env.volumePort),
|
||||
@@ -123,7 +126,12 @@ func (env *oauthTestEnv) start(t *testing.T) {
|
||||
"-ip", env.bindIP,
|
||||
"-ip.bind", "0.0.0.0",
|
||||
"-dir", env.dataDir,
|
||||
)
|
||||
}
|
||||
if env.s3ExternalURL != "" {
|
||||
args = append(args, "-s3.externalUrl", env.s3ExternalURL)
|
||||
}
|
||||
|
||||
cmd := exec.CommandContext(ctx, env.weedBinary, args...)
|
||||
cmd.Dir = env.dataDir
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
@@ -216,8 +224,12 @@ func TestOAuthTokenEndpoint(t *testing.T) {
|
||||
t.Run("bearer token auth on catalog endpoint", func(t *testing.T) {
|
||||
token := requestOAuthToken(t, env, env.accessKey, env.secretKey)
|
||||
|
||||
// Use the token to call the catalog
|
||||
req, err := http.NewRequest(http.MethodGet, env.icebergURL()+"/v1/namespaces", nil)
|
||||
// Point the call at a table bucket that exists, so anything but 200 is an
|
||||
// auth or routing fault rather than the catalog reporting a missing bucket.
|
||||
bucketName := "oauth-bearer-" + randomSuffix()
|
||||
createTableBucketViaShell(t, env, bucketName)
|
||||
|
||||
req, err := http.NewRequest(http.MethodGet, env.icebergURL()+"/v1/"+bucketName+"/namespaces", nil)
|
||||
if err != nil {
|
||||
t.Fatalf("create request: %v", err)
|
||||
}
|
||||
@@ -225,17 +237,12 @@ func TestOAuthTokenEndpoint(t *testing.T) {
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
t.Fatalf("GET /v1/namespaces with Bearer: %v", err)
|
||||
t.Fatalf("GET /v1/%s/namespaces with Bearer: %v", bucketName, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
// Auth should pass. We accept 200 (success) or 500 (missing warehouse bucket
|
||||
// is an internal error, not an auth error). Reject 401/403/404/405.
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
switch resp.StatusCode {
|
||||
case http.StatusOK, http.StatusInternalServerError:
|
||||
t.Logf("Bearer token auth succeeded, status=%d", resp.StatusCode)
|
||||
default:
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
t.Fatalf("Bearer auth failed unexpectedly: status=%d body=%s", resp.StatusCode, body)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
// Tests for the credential-vending access pattern.
|
||||
//
|
||||
// DuckDB attaches a catalog with "X-Iceberg-Access-Delegation: vended-credentials"
|
||||
// and rebuilds its S3 credential out of whatever LoadTable returns in `config`,
|
||||
// dropping the S3 secret it was configured with. A catalog that advertises an
|
||||
// endpoint there but vends no credentials therefore leaves DuckDB sending
|
||||
// unsigned requests, and every metadata and data file comes back 403.
|
||||
//
|
||||
// These run against a weed mini started with -s3.externalUrl, which is what
|
||||
// makes the catalog advertise an endpoint at all; with a wildcard bind and no
|
||||
// external URL the config is empty and the bug cannot appear.
|
||||
package catalog
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/test/testutil"
|
||||
)
|
||||
|
||||
// duckDBImage tracks whatever DuckDB users are actually running, matching the
|
||||
// other DuckDB tests here: a client that changes how it handles vended
|
||||
// credentials is exactly what this suite exists to catch.
|
||||
const duckDBImage = "duckdb/duckdb:latest"
|
||||
|
||||
// requireDuckDBIceberg skips when the image cannot install the iceberg
|
||||
// extension -- no egress, or a build without it. Probing separately keeps the
|
||||
// round trip below free to fail on any error instead of having to guess which
|
||||
// DuckDB messages mean "no extension" and which mean "the catalog is broken".
|
||||
func requireDuckDBIceberg(t *testing.T) {
|
||||
t.Helper()
|
||||
|
||||
const ready = "iceberg extension ready"
|
||||
cmd := exec.Command("docker", "run", "--rm",
|
||||
"--entrypoint", "duckdb",
|
||||
duckDBImage,
|
||||
"-c", fmt.Sprintf("INSTALL iceberg; LOAD iceberg; SELECT '%s' AS marker;", ready),
|
||||
)
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil || !strings.Contains(string(output), ready) {
|
||||
t.Skipf("DuckDB image cannot load the iceberg extension: %v\n%s", err, output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIcebergVendedCredentials(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
|
||||
env := newOAuthTestEnv(t)
|
||||
// The DuckDB container reaches S3 through host.docker.internal, so advertise
|
||||
// the endpoint under the name the client can actually resolve.
|
||||
env.s3ExternalURL = fmt.Sprintf("http://host.docker.internal:%d", env.s3Port)
|
||||
defer env.cleanup(t)
|
||||
env.start(t)
|
||||
|
||||
bucketName := "vendcreds-" + randomSuffix()
|
||||
namespace := "vendcreds_ns_" + randomSuffix()
|
||||
tableName := "vendcreds_tbl_" + randomSuffix()
|
||||
|
||||
createTableBucketViaShell(t, env, bucketName)
|
||||
token := requestOAuthToken(t, env, env.accessKey, env.secretKey)
|
||||
createNamespaceWithToken(t, env, token, bucketName, namespace)
|
||||
createTableWithToken(t, env, token, bucketName, namespace, tableName)
|
||||
|
||||
t.Run("plain load table advertises the endpoint", func(t *testing.T) {
|
||||
config := loadTableConfig(t, env, token, bucketName, namespace, tableName, "")
|
||||
if config["s3.endpoint"] != env.s3ExternalURL {
|
||||
t.Fatalf("s3.endpoint = %q, want %q (clients that bring their own credentials still need the endpoint)",
|
||||
config["s3.endpoint"], env.s3ExternalURL)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("vended credentials request gets no half-configured storage", func(t *testing.T) {
|
||||
config := loadTableConfig(t, env, token, bucketName, namespace, tableName, "vended-credentials")
|
||||
if config["s3.endpoint"] == "" {
|
||||
return
|
||||
}
|
||||
// If the catalog ever does vend credentials, the endpoint may come back
|
||||
// -- but only alongside the credentials that make it usable.
|
||||
if config["s3.access-key-id"] == "" || config["s3.secret-access-key"] == "" {
|
||||
t.Fatalf("LoadTable config = %v: a client that asked for vended credentials drops its own and signs with what it gets, so an endpoint without credentials makes every data file read 403", config)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("duckdb writes and reads back through the catalog", func(t *testing.T) {
|
||||
if !testutil.HasDocker() {
|
||||
t.Skip("Docker not available, skipping DuckDB round trip")
|
||||
}
|
||||
requireDuckDBIceberg(t)
|
||||
duckDBRoundTrip(t, env, bucketName, namespace)
|
||||
})
|
||||
}
|
||||
|
||||
// duckDBRoundTrip runs the reporter's flow: attach the catalog, create a table
|
||||
// from a query, then read it back. Both halves need signed S3 access to the
|
||||
// table's metadata and data files.
|
||||
func duckDBRoundTrip(t *testing.T, env *oauthTestEnv, bucketName, namespace string) {
|
||||
t.Helper()
|
||||
|
||||
const marker = "vended-credentials round trip ok"
|
||||
sql := fmt.Sprintf(`
|
||||
INSTALL iceberg;
|
||||
LOAD iceberg;
|
||||
|
||||
CREATE SECRET iceberg_secret (
|
||||
TYPE ICEBERG,
|
||||
ENDPOINT 'http://host.docker.internal:%d',
|
||||
CLIENT_ID '%s',
|
||||
CLIENT_SECRET '%s'
|
||||
);
|
||||
|
||||
CREATE SECRET s3_secret (
|
||||
TYPE S3,
|
||||
KEY_ID '%s',
|
||||
SECRET '%s',
|
||||
ENDPOINT 'host.docker.internal:%d',
|
||||
URL_STYLE 'path',
|
||||
USE_SSL false
|
||||
);
|
||||
|
||||
ATTACH 's3://%s' AS vend_cat (
|
||||
TYPE ICEBERG,
|
||||
SECRET iceberg_secret,
|
||||
ENDPOINT 'http://host.docker.internal:%d',
|
||||
READ_ONLY false
|
||||
);
|
||||
|
||||
CREATE TABLE vend_cat.%s.round_trip AS SELECT 42 AS answer;
|
||||
|
||||
SELECT CASE WHEN sum(answer) = 42 THEN '%s' ELSE 'wrong answer' END AS marker
|
||||
FROM vend_cat.%s.round_trip;
|
||||
`,
|
||||
env.icebergPort, env.accessKey, env.secretKey,
|
||||
env.accessKey, env.secretKey, env.s3Port,
|
||||
bucketName, env.icebergPort,
|
||||
namespace, marker, namespace,
|
||||
)
|
||||
|
||||
sqlFile := filepath.Join(env.dataDir, "duckdb_vended_credentials.sql")
|
||||
if err := os.WriteFile(sqlFile, []byte(sql), 0644); err != nil {
|
||||
t.Fatalf("write SQL file: %v", err)
|
||||
}
|
||||
|
||||
cmd := exec.Command("docker", "run", "--rm",
|
||||
"-v", fmt.Sprintf("%s:/test", env.dataDir),
|
||||
"--add-host", "host.docker.internal:host-gateway",
|
||||
"-e", "AWS_REGION=us-east-1",
|
||||
"--entrypoint", "duckdb",
|
||||
duckDBImage,
|
||||
"-init", "/test/duckdb_vended_credentials.sql",
|
||||
"-c", "SELECT 1",
|
||||
)
|
||||
output, err := cmd.CombinedOutput()
|
||||
outputStr := string(output)
|
||||
t.Logf("DuckDB output:\n%s", outputStr)
|
||||
|
||||
// Nothing below skips: requireDuckDBIceberg already established that the
|
||||
// extension loads, so any failure from here is the catalog's.
|
||||
if strings.Contains(outputStr, "trying to refresh secret") {
|
||||
t.Fatalf("DuckDB fell back to refreshing the credential the catalog vended, which no stage-created table can satisfy:\n%s", outputStr)
|
||||
}
|
||||
// Match the phrasings rather than a bare "403", which a random port could
|
||||
// carry.
|
||||
for _, denial := range []string{"AccessDenied", "403 Forbidden", "code 403"} {
|
||||
if strings.Contains(outputStr, denial) {
|
||||
t.Fatalf("DuckDB signed its S3 requests with the catalog's credential-less config:\n%s", outputStr)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(outputStr, marker) {
|
||||
t.Fatalf("DuckDB did not write and read the table back (err=%v):\n%s", err, outputStr)
|
||||
}
|
||||
}
|
||||
|
||||
// loadTableConfig loads a table and returns the FileIO config the catalog
|
||||
// advertises, optionally asking for an access delegation mechanism.
|
||||
func loadTableConfig(t *testing.T, env *oauthTestEnv, token, bucketName, namespace, tableName, delegation string) map[string]string {
|
||||
t.Helper()
|
||||
|
||||
url := fmt.Sprintf("%s/v1/%s/namespaces/%s/tables/%s", env.icebergURL(), bucketName, namespace, tableName)
|
||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("create request: %v", err)
|
||||
}
|
||||
req.Header.Set("Authorization", "Bearer "+token)
|
||||
if delegation != "" {
|
||||
req.Header.Set("X-Iceberg-Access-Delegation", delegation)
|
||||
}
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
t.Fatalf("load table: %v", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
t.Fatalf("load table failed: status=%d body=%s", resp.StatusCode, body)
|
||||
}
|
||||
|
||||
var result struct {
|
||||
Config map[string]string `json:"config"`
|
||||
}
|
||||
if err := json.Unmarshal(body, &result); err != nil {
|
||||
t.Fatalf("decode LoadTableResult: %v", err)
|
||||
}
|
||||
return result.Config
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
# Known winfsp-tests failures for the SeaweedFS Windows mount.
|
||||
#
|
||||
# One test name per line, as winfsp-tests reports it. A trailing * matches a
|
||||
# prefix, so "stream_*" covers a whole group. Listed tests are excluded from
|
||||
# the run; a failure in anything NOT listed fails CI, which is what catches a
|
||||
# regression.
|
||||
#
|
||||
# Every test runs on its own in a clean directory, so an entry here is a real
|
||||
# defect rather than the wreckage of the test before it. The rdwr and flush
|
||||
# group is gone from this list for exactly that reason: it passes in isolation
|
||||
# and only failed as collateral. Every entry below is a
|
||||
# gap in the mount rather than a quirk of the suite, and the list is meant to
|
||||
# shrink. Keep a reason on each group — an entry with no reason cannot be told
|
||||
# apart from one nobody has looked at.
|
||||
|
||||
# Cannot pass by construction
|
||||
# ---------------------------
|
||||
# Alternate data streams: the filer stores one byte range per entry, and the
|
||||
# mount exposes no second stream.
|
||||
stream_*
|
||||
# Reparse points: Symlink is refused, so there is nothing to resolve.
|
||||
reparse_*
|
||||
# Byte-range locks live in the WinFsp driver, so they never reach the mount.
|
||||
lock_*
|
||||
|
||||
# Security descriptors
|
||||
# --------------------
|
||||
# The mount carries unix mode bits and no ACL, and Chown accepts and discards,
|
||||
# so a descriptor written here does not read back.
|
||||
create_sd_test
|
||||
getsecurity_test
|
||||
|
||||
# Memory-mapped IO
|
||||
# ----------------
|
||||
# rdwr-test.c:645 compares the mapped bytes against the pattern that was
|
||||
# written and finds them different. A real data mismatch, not a cascade: it
|
||||
# only surfaced once each test ran on its own and this one got far enough to
|
||||
# check. Worth its own investigation.
|
||||
rdwr_mmap_test
|
||||
|
||||
# Delete semantics
|
||||
# ----------------
|
||||
# WinFsp advertises POSIX unlink, so a file can be deleted while handles are
|
||||
# still open; the mount does not implement the delete-pending state.
|
||||
delete_access_test
|
||||
delete_ex_test
|
||||
delete_mmap_test
|
||||
delete_pending_test
|
||||
|
||||
# Rename semantics
|
||||
# ----------------
|
||||
# Rename over an open file, and rename of a directory holding open handles,
|
||||
# which WinFsp is stricter about than POSIX.
|
||||
rename_ex_test
|
||||
rename_mmap_test
|
||||
rename_open_test
|
||||
exec_rename_dir_test
|
||||
|
||||
# File information
|
||||
# ----------------
|
||||
# A regular file reports as archived now, but hidden, system and readonly are
|
||||
# still not round-tripped: create_fileattr gets past the archive check and then
|
||||
# asks for READONLY as well, which needs Chflags. Creation time is reported as
|
||||
# ctime because the raw protocol's Attr carries no field for it outside darwin.
|
||||
create_fileattr_test
|
||||
# getfileinfo asserts a file created a moment ago has an access time within ten
|
||||
# seconds of now, and it does not. Two causes have been fixed and neither was
|
||||
# it: Utimens no longer stores a zero timestamp, and the in-memory overlays are
|
||||
# dropped when an inode is released so a recycled number cannot inherit an old
|
||||
# time. Still unexplained, so it stays listed rather than pretended about.
|
||||
getfileinfo_test
|
||||
create_readonlydir_test
|
||||
setfileinfo_test
|
||||
|
||||
# Directory enumeration
|
||||
# ---------------------
|
||||
# querydir_namelen only: checkName caps at 255 bytes while WinFsp counts 255
|
||||
# characters. The other two are expected to pass now that "." and ".." are
|
||||
# reported for non-root directories, which is what WinFsp enumerates.
|
||||
querydir_namelen_test
|
||||
|
||||
# Name length
|
||||
# -----------
|
||||
# checkName caps at 255 bytes while WinFsp allows 255 characters, so a CJK
|
||||
# name that is legal to Windows is rejected here.
|
||||
create_namelen_test
|
||||
|
||||
# Sharing modes
|
||||
# -------------
|
||||
# Windows share-access checking on create, which the mount does not enforce.
|
||||
create_share_test
|
||||
create_test
|
||||
@@ -0,0 +1,112 @@
|
||||
# Runs WinFsp's own conformance suite against a mounted SeaweedFS drive.
|
||||
#
|
||||
# winfsp-tests is what WinFsp uses to check a filesystem behaves like NTFS,
|
||||
# and --fuse-external points it at somebody else's filesystem instead of the
|
||||
# bundled memfs. It is the Windows counterpart of the pjdfstest run the FUSE
|
||||
# mount already goes through, and it is scored the same way: anything failing
|
||||
# that is not in known_failures.txt is a regression.
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$MountPoint,
|
||||
[string]$KnownFailures = "$PSScriptRoot\known_failures.txt",
|
||||
[string]$WinFspTestsVersion = '2.1.25156'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# "S:" and "S:\" mean different things to Join-Path: without the separator the
|
||||
# result is relative to the drive's current directory, not its root.
|
||||
if ($MountPoint -notmatch '[\\/]$') { $MountPoint = $MountPoint + '\' }
|
||||
|
||||
# winfsp-tests links against winfsp-x64.dll, which the MSI puts somewhere the
|
||||
# loader does not look by default.
|
||||
foreach ($candidate in @("${env:ProgramFiles(x86)}\WinFsp\bin", "$env:ProgramFiles\WinFsp\bin")) {
|
||||
if (Test-Path $candidate) {
|
||||
$env:PATH = "$candidate;$env:PATH"
|
||||
Write-Host "using WinFsp binaries from $candidate"
|
||||
}
|
||||
}
|
||||
|
||||
$toolDir = Join-Path $env:TEMP 'winfsp-tests'
|
||||
$exe = Join-Path $toolDir 'winfsp-tests-x64.exe'
|
||||
if (-not (Test-Path $exe)) {
|
||||
# Shipped as its own archive rather than in the MSI.
|
||||
$url = "https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-tests-$WinFspTestsVersion.zip"
|
||||
$zip = Join-Path $env:TEMP 'winfsp-tests.zip'
|
||||
Write-Host "downloading $url"
|
||||
Invoke-WebRequest -Uri $url -OutFile $zip -UseBasicParsing
|
||||
Expand-Archive -LiteralPath $zip -DestinationPath $toolDir -Force
|
||||
}
|
||||
if (-not (Test-Path $exe)) {
|
||||
throw "winfsp-tests-x64.exe not found under $toolDir"
|
||||
}
|
||||
|
||||
# A missing or unreadable list would otherwise run with nothing excluded and
|
||||
# report that as normal, which reads like a pass with no known failures.
|
||||
if (-not (Test-Path $KnownFailures)) {
|
||||
throw "known failures list not found at $KnownFailures"
|
||||
}
|
||||
$excluded = @(Get-Content $KnownFailures |
|
||||
ForEach-Object { $_.Trim() } |
|
||||
Where-Object { $_ -and -not $_.StartsWith('#') })
|
||||
Write-Host "read $($excluded.Count) exclusions from $KnownFailures"
|
||||
if ($excluded.Count -eq 0) {
|
||||
throw "known failures list at $KnownFailures parsed to nothing"
|
||||
}
|
||||
|
||||
# The suite refuses to run anywhere but a drive, and works in the current
|
||||
# directory, so it has to be driven from inside the mount.
|
||||
$workDir = Join-Path $MountPoint 'winfsp-conformance'
|
||||
New-Item -ItemType Directory -Force -Path $workDir | Out-Null
|
||||
Push-Location $workDir
|
||||
try {
|
||||
# --fuse-external: a third-party FUSE filesystem, not the bundled memfs.
|
||||
# --resilient: tolerate operations this filesystem does not implement.
|
||||
#
|
||||
# One test per invocation, each in its own directory. Batched with
|
||||
# --no-abort, a test that failed part way left its files behind and the
|
||||
# next one failed creating them, reporting a cascade of failures that were
|
||||
# really one. This costs a process start per test and makes the list mean
|
||||
# what it says.
|
||||
$base = @('--fuse-external', '--resilient')
|
||||
$names = @(& $exe @base '--list' 2>&1 |
|
||||
ForEach-Object { if ($_ -match '^([a-z_0-9]+)\s*$') { $Matches[1] } })
|
||||
if ($names.Count -eq 0) { throw "could not list tests" }
|
||||
Write-Host "listed $($names.Count) tests"
|
||||
|
||||
$failed = @()
|
||||
$ran = 0
|
||||
foreach ($name in $names) {
|
||||
if ($excluded | Where-Object { $name -like $_ }) { continue }
|
||||
$ran++
|
||||
$caseDir = Join-Path $workDir $name
|
||||
# -Force creates the directory but leaves anything already in it, and
|
||||
# a leftover file is the very thing this isolation exists to avoid.
|
||||
Remove-Item $caseDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
New-Item -ItemType Directory -Force -Path $caseDir | Out-Null
|
||||
Push-Location $caseDir
|
||||
try {
|
||||
$out = & $exe @base $name 2>&1
|
||||
$out | ForEach-Object { Write-Host $_ }
|
||||
if ($out -match '\s+KO\s*$' -or $LASTEXITCODE -ne 0) { $failed += $name }
|
||||
} finally {
|
||||
Pop-Location
|
||||
Remove-Item $caseDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
Write-Host "ran $ran tests, $($failed.Count) failed"
|
||||
$code = if ($failed.Count -gt 0) { 1 } else { 0 }
|
||||
} finally {
|
||||
Pop-Location
|
||||
Remove-Item $workDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
if ($failed.Count -gt 0) {
|
||||
Write-Host "::error::winfsp-tests failures outside known_failures.txt: $($failed -join ', ')"
|
||||
exit 1
|
||||
}
|
||||
if ($code -ne 0) {
|
||||
Write-Host "::error::winfsp-tests exited $code with no failure reported"
|
||||
exit $code
|
||||
}
|
||||
Write-Host 'winfsp-tests passed'
|
||||
@@ -0,0 +1,7 @@
|
||||
package winfsp
|
||||
|
||||
import "errors"
|
||||
|
||||
// errWindowsOnly marks the platforms with no way to ask for delete-on-close,
|
||||
// so the test can tell that apart from the flag being refused.
|
||||
var errWindowsOnly = errors.New("delete-on-close is a windows flag")
|
||||
@@ -0,0 +1,9 @@
|
||||
//go:build !windows
|
||||
|
||||
package winfsp
|
||||
|
||||
type handle uintptr
|
||||
|
||||
func createDeleteOnClose(path string) (handle, error) { return 0, errWindowsOnly }
|
||||
|
||||
func closeHandle(h handle) error { return errWindowsOnly }
|
||||
@@ -0,0 +1,24 @@
|
||||
package winfsp
|
||||
|
||||
import "golang.org/x/sys/windows"
|
||||
|
||||
// createDeleteOnClose opens a new file that Windows removes when the last
|
||||
// handle to it closes. Installers and editors use this for temporaries, and
|
||||
// os has no way to ask for it.
|
||||
func createDeleteOnClose(path string) (windows.Handle, error) {
|
||||
p, err := windows.UTF16PtrFromString(path)
|
||||
if err != nil {
|
||||
return windows.InvalidHandle, err
|
||||
}
|
||||
return windows.CreateFile(
|
||||
p,
|
||||
windows.GENERIC_READ|windows.GENERIC_WRITE,
|
||||
windows.FILE_SHARE_READ|windows.FILE_SHARE_WRITE,
|
||||
nil,
|
||||
windows.CREATE_NEW,
|
||||
windows.FILE_ATTRIBUTE_NORMAL|windows.FILE_FLAG_DELETE_ON_CLOSE,
|
||||
0,
|
||||
)
|
||||
}
|
||||
|
||||
func closeHandle(h windows.Handle) error { return windows.CloseHandle(h) }
|
||||
@@ -0,0 +1,9 @@
|
||||
//go:build !windows
|
||||
|
||||
package winfsp
|
||||
|
||||
import "errors"
|
||||
|
||||
func getDiskFreeSpace(path string, free, total, totalFree *uint64) error {
|
||||
return errors.New("windows only")
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func getDiskFreeSpace(path string, free, total, totalFree *uint64) error {
|
||||
p, err := windows.UTF16PtrFromString(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return windows.GetDiskFreeSpaceEx(p, free, total, totalFree)
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
// Package winfsp exercises a live SeaweedFS mount on Windows.
|
||||
//
|
||||
// It runs against whatever is mounted at -mountpoint, so it needs a real
|
||||
// WinFsp mount and is skipped otherwise. The CI job drives it; run it by hand
|
||||
// with: go test ./test/winfsp -mountpoint=S:\
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var mountPoint = flag.String("mountpoint", "", "a mounted SeaweedFS drive, e.g. S:\\")
|
||||
|
||||
// entryCount is the directory width the test builds. The reported case that
|
||||
// motivated Windows support is 200k files in one folder; CI uses less so the
|
||||
// job stays inside its budget, but the read path is the same.
|
||||
var entryCount = flag.Int("entries", 5000, "how many files to put in one directory")
|
||||
|
||||
func testRoot(t *testing.T) string {
|
||||
t.Helper()
|
||||
if *mountPoint == "" {
|
||||
t.Skip("no -mountpoint given; this test needs a live WinFsp mount")
|
||||
}
|
||||
dir := filepath.Join(*mountPoint, "winfsp-test-"+t.Name())
|
||||
if err := os.RemoveAll(dir); err != nil && !os.IsNotExist(err) {
|
||||
t.Fatalf("clean %s: %v", dir, err)
|
||||
}
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
t.Fatalf("mkdir %s: %v", dir, err)
|
||||
}
|
||||
t.Cleanup(func() { os.RemoveAll(dir) })
|
||||
return dir
|
||||
}
|
||||
|
||||
func TestWriteReadRoundTrip(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
for _, size := range []int{0, 1, 4095, 4096, 1 << 20, 5 << 20} {
|
||||
t.Run(fmt.Sprintf("%dbytes", size), func(t *testing.T) {
|
||||
want := make([]byte, size)
|
||||
if _, err := rand.Read(want); err != nil {
|
||||
t.Fatalf("rand: %v", err)
|
||||
}
|
||||
path := filepath.Join(dir, fmt.Sprintf("file-%d", size))
|
||||
if err := os.WriteFile(path, want, 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
got, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("read: %v", err)
|
||||
}
|
||||
if !bytes.Equal(got, want) {
|
||||
t.Fatalf("content differs: got %d bytes, want %d", len(got), len(want))
|
||||
}
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatalf("stat: %v", err)
|
||||
}
|
||||
if info.Size() != int64(size) {
|
||||
t.Fatalf("stat size = %d, want %d", info.Size(), size)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSeekWriteAndOverwrite(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "sparse")
|
||||
|
||||
f, err := os.Create(path)
|
||||
if err != nil {
|
||||
t.Fatalf("create: %v", err)
|
||||
}
|
||||
if _, err := f.WriteAt([]byte("tail"), 4096); err != nil {
|
||||
t.Fatalf("write at offset: %v", err)
|
||||
}
|
||||
if _, err := f.WriteAt([]byte("head"), 0); err != nil {
|
||||
t.Fatalf("write at start: %v", err)
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
t.Fatalf("close: %v", err)
|
||||
}
|
||||
|
||||
got, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("read: %v", err)
|
||||
}
|
||||
if len(got) != 4100 {
|
||||
t.Fatalf("size = %d, want 4100", len(got))
|
||||
}
|
||||
if string(got[:4]) != "head" || string(got[4096:]) != "tail" {
|
||||
t.Fatalf("content at the edges is wrong: %q ... %q", got[:4], got[4096:])
|
||||
}
|
||||
if !bytes.Equal(got[4:4096], make([]byte, 4092)) {
|
||||
t.Fatal("the hole between the two writes is not zero-filled")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRenameAndDelete(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
src := filepath.Join(dir, "before")
|
||||
dst := filepath.Join(dir, "after")
|
||||
|
||||
if err := os.WriteFile(src, []byte("payload"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
if err := os.Rename(src, dst); err != nil {
|
||||
t.Fatalf("rename: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(src); !os.IsNotExist(err) {
|
||||
t.Fatalf("old name still resolves: %v", err)
|
||||
}
|
||||
got, err := os.ReadFile(dst)
|
||||
if err != nil {
|
||||
t.Fatalf("read renamed: %v", err)
|
||||
}
|
||||
if string(got) != "payload" {
|
||||
t.Fatalf("content after rename = %q", got)
|
||||
}
|
||||
if err := os.Remove(dst); err != nil {
|
||||
t.Fatalf("remove: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(dst); !os.IsNotExist(err) {
|
||||
t.Fatalf("deleted file still resolves: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDirectoryTree(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
nested := filepath.Join(dir, "a", "b", "c")
|
||||
if err := os.MkdirAll(nested, 0755); err != nil {
|
||||
t.Fatalf("mkdirall: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(nested, "leaf"), []byte("x"), 0644); err != nil {
|
||||
t.Fatalf("write leaf: %v", err)
|
||||
}
|
||||
info, err := os.Stat(nested)
|
||||
if err != nil {
|
||||
t.Fatalf("stat dir: %v", err)
|
||||
}
|
||||
if !info.IsDir() {
|
||||
t.Fatal("nested path is not reported as a directory")
|
||||
}
|
||||
// A non-empty directory must not be removable.
|
||||
if err := os.Remove(filepath.Join(dir, "a", "b")); err == nil {
|
||||
t.Fatal("removed a non-empty directory")
|
||||
}
|
||||
if err := os.RemoveAll(filepath.Join(dir, "a")); err != nil {
|
||||
t.Fatalf("removeall: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// TestWideDirectory is the case from the report: one folder holding far more
|
||||
// entries than Explorer or the Windows WebDAV client cope with.
|
||||
func TestWideDirectory(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
want := make([]string, 0, *entryCount)
|
||||
for i := 0; i < *entryCount; i++ {
|
||||
name := fmt.Sprintf("img-%06d.dat", i)
|
||||
if err := os.WriteFile(filepath.Join(dir, name), []byte{byte(i)}, 0644); err != nil {
|
||||
t.Fatalf("write %s: %v", name, err)
|
||||
}
|
||||
want = append(want, name)
|
||||
}
|
||||
|
||||
entries, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
t.Fatalf("readdir: %v", err)
|
||||
}
|
||||
got := make([]string, 0, len(entries))
|
||||
for _, e := range entries {
|
||||
got = append(got, e.Name())
|
||||
}
|
||||
sort.Strings(got)
|
||||
sort.Strings(want)
|
||||
if len(got) != len(want) {
|
||||
t.Fatalf("readdir returned %d entries, want %d", len(got), len(want))
|
||||
}
|
||||
for i := range want {
|
||||
if got[i] != want[i] {
|
||||
t.Fatalf("entry %d = %q, want %q", i, got[i], want[i])
|
||||
}
|
||||
}
|
||||
|
||||
// Reading the directory twice must be stable; a paging bug shows up here.
|
||||
again, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
t.Fatalf("second readdir: %v", err)
|
||||
}
|
||||
if len(again) != len(entries) {
|
||||
t.Fatalf("second readdir returned %d entries, first returned %d", len(again), len(entries))
|
||||
}
|
||||
}
|
||||
|
||||
func TestConcurrentWriters(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
const writers = 8
|
||||
const perWriter = 32
|
||||
|
||||
var wg sync.WaitGroup
|
||||
errs := make(chan error, writers)
|
||||
for w := 0; w < writers; w++ {
|
||||
wg.Add(1)
|
||||
go func(w int) {
|
||||
defer wg.Done()
|
||||
for i := 0; i < perWriter; i++ {
|
||||
name := filepath.Join(dir, fmt.Sprintf("w%d-%d", w, i))
|
||||
body := []byte(strings.Repeat(fmt.Sprintf("%d", w), 128))
|
||||
if err := os.WriteFile(name, body, 0644); err != nil {
|
||||
errs <- fmt.Errorf("writer %d: %w", w, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}(w)
|
||||
}
|
||||
wg.Wait()
|
||||
close(errs)
|
||||
for err := range errs {
|
||||
t.Fatalf("%v", err)
|
||||
}
|
||||
|
||||
entries, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
t.Fatalf("readdir: %v", err)
|
||||
}
|
||||
if len(entries) != writers*perWriter {
|
||||
t.Fatalf("got %d files, want %d", len(entries), writers*perWriter)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStatfsReportsCapacity(t *testing.T) {
|
||||
if *mountPoint == "" {
|
||||
t.Skip("no -mountpoint given; this test needs a live WinFsp mount")
|
||||
}
|
||||
// The drive has to report a size, or Explorer refuses to show it.
|
||||
var free, total, totalFree uint64
|
||||
if err := getDiskFreeSpace(*mountPoint, &free, &total, &totalFree); err != nil {
|
||||
t.Fatalf("GetDiskFreeSpaceEx: %v", err)
|
||||
}
|
||||
if total == 0 {
|
||||
t.Fatal("drive reports zero total bytes")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
// phase splits the test across a remount: the write phase is run, the
|
||||
// mount is torn down and brought back, then the verify phase runs. Reading
|
||||
// back through the same live mount proves nothing about durability, since
|
||||
// the answer can come from the mount's own caches.
|
||||
phase = flag.String("phase", "", "write or verify; empty skips the persistence test")
|
||||
|
||||
// filerAddr enables a second check, that the bytes reached the filer and
|
||||
// are servable without the mount in the path at all.
|
||||
filerAddr = flag.String("filer", "", "filer host:port to cross-check through, e.g. localhost:8888")
|
||||
|
||||
// persistSubdir is where the fixtures live, under both the mount and the
|
||||
// filer's mount root.
|
||||
persistSubdir = flag.String("persistdir", "winfsp-persist", "directory under the mount to persist into")
|
||||
)
|
||||
|
||||
type fixture struct {
|
||||
relPath string
|
||||
size int
|
||||
}
|
||||
|
||||
// Sizes straddle the boundaries where the write path changes behavior: inline,
|
||||
// a single chunk, and several chunks.
|
||||
var fixtures = []fixture{
|
||||
{"small.txt", 11},
|
||||
{"medium.bin", 300 << 10},
|
||||
{"multichunk.bin", 9 << 20},
|
||||
{"nested/deep/leaf.bin", 65536},
|
||||
{"unicode-café-日本.txt", 64},
|
||||
}
|
||||
|
||||
// contentFor derives bytes from the name, so the write and verify phases agree
|
||||
// without carrying a manifest between them.
|
||||
func contentFor(relPath string, size int) []byte {
|
||||
h := fnv.New64a()
|
||||
h.Write([]byte(relPath))
|
||||
state := h.Sum64() | 1
|
||||
out := make([]byte, size)
|
||||
for i := range out {
|
||||
state ^= state << 13
|
||||
state ^= state >> 7
|
||||
state ^= state << 17
|
||||
out[i] = byte(state)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func TestPersistence(t *testing.T) {
|
||||
if *mountPoint == "" {
|
||||
t.Skip("no -mountpoint given; this test needs a live WinFsp mount")
|
||||
}
|
||||
switch *phase {
|
||||
case "write":
|
||||
persistenceWrite(t)
|
||||
case "verify":
|
||||
persistenceVerify(t)
|
||||
default:
|
||||
t.Skip("no -phase given; run with -phase=write before a remount and -phase=verify after")
|
||||
}
|
||||
}
|
||||
|
||||
func persistenceWrite(t *testing.T) {
|
||||
root := filepath.Join(*mountPoint, *persistSubdir)
|
||||
if err := os.RemoveAll(root); err != nil && !os.IsNotExist(err) {
|
||||
t.Fatalf("clean %s: %v", root, err)
|
||||
}
|
||||
if err := os.MkdirAll(root, 0755); err != nil {
|
||||
t.Fatalf("mkdir %s: %v", root, err)
|
||||
}
|
||||
|
||||
for _, f := range fixtures {
|
||||
target := filepath.Join(root, filepath.FromSlash(f.relPath))
|
||||
if err := os.MkdirAll(filepath.Dir(target), 0755); err != nil {
|
||||
t.Fatalf("mkdir for %s: %v", f.relPath, err)
|
||||
}
|
||||
// Sync before closing: the mount is killed rather than unmounted, so
|
||||
// anything still queued for flush is legitimately lost. Testing
|
||||
// durability means testing what survives after an explicit sync.
|
||||
if err := writeAndSync(target, contentFor(f.relPath, f.size)); err != nil {
|
||||
t.Fatalf("write %s: %v", f.relPath, err)
|
||||
}
|
||||
t.Logf("wrote %s (%d bytes)", f.relPath, f.size)
|
||||
}
|
||||
|
||||
// Closing the files should have pushed them to the filer. Check that
|
||||
// directly, so a failure here separates "never left the mount" from
|
||||
// "did not survive the remount".
|
||||
if *filerAddr == "" {
|
||||
return
|
||||
}
|
||||
for _, f := range fixtures {
|
||||
want := contentFor(f.relPath, f.size)
|
||||
got, err := fetchFromFiler(*filerAddr, path.Join(*persistSubdir, f.relPath))
|
||||
if err != nil {
|
||||
t.Errorf("fetch %s from filer: %v", f.relPath, err)
|
||||
continue
|
||||
}
|
||||
if !bytes.Equal(got, want) {
|
||||
t.Errorf("filer served %d bytes for %s, want %d", len(got), f.relPath, len(want))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func persistenceVerify(t *testing.T) {
|
||||
root := filepath.Join(*mountPoint, *persistSubdir)
|
||||
if _, err := os.Stat(root); err != nil {
|
||||
t.Fatalf("stat %s after remount: %v", root, err)
|
||||
}
|
||||
|
||||
for _, f := range fixtures {
|
||||
target := filepath.Join(root, filepath.FromSlash(f.relPath))
|
||||
got, err := os.ReadFile(target)
|
||||
if err != nil {
|
||||
t.Errorf("read %s after remount: %v", f.relPath, err)
|
||||
continue
|
||||
}
|
||||
want := contentFor(f.relPath, f.size)
|
||||
if len(got) != len(want) {
|
||||
t.Errorf("%s is %d bytes after remount, want %d", f.relPath, len(got), len(want))
|
||||
continue
|
||||
}
|
||||
if !bytes.Equal(got, want) {
|
||||
t.Errorf("%s survived the remount with different content", f.relPath)
|
||||
}
|
||||
}
|
||||
|
||||
// The directory structure has to come back too, not just the files.
|
||||
entries, err := os.ReadDir(root)
|
||||
if err != nil {
|
||||
t.Fatalf("readdir %s after remount: %v", root, err)
|
||||
}
|
||||
if len(entries) == 0 {
|
||||
t.Fatal("mount root directory is empty after remount")
|
||||
}
|
||||
|
||||
if err := os.RemoveAll(root); err != nil {
|
||||
t.Errorf("cleanup: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func writeAndSync(path string, content []byte) error {
|
||||
f, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := f.Write(content); err != nil {
|
||||
f.Close()
|
||||
return err
|
||||
}
|
||||
if err := f.Sync(); err != nil {
|
||||
f.Close()
|
||||
return err
|
||||
}
|
||||
return f.Close()
|
||||
}
|
||||
|
||||
func fetchFromFiler(addr, filerPath string) ([]byte, error) {
|
||||
endpoint := &url.URL{Scheme: "http", Host: addr, Path: "/" + filerPath}
|
||||
client := &http.Client{Timeout: 60 * time.Second}
|
||||
resp, err := client.Get(endpoint.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("GET %s: %s", endpoint, resp.Status)
|
||||
}
|
||||
return io.ReadAll(resp.Body)
|
||||
}
|
||||
@@ -0,0 +1,502 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestTruncate(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "resize")
|
||||
original := bytes.Repeat([]byte("abcd"), 4096) // 16 KiB
|
||||
|
||||
if err := os.WriteFile(path, original, 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
|
||||
// Shrink.
|
||||
if err := os.Truncate(path, 100); err != nil {
|
||||
t.Fatalf("truncate down: %v", err)
|
||||
}
|
||||
got, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("read after shrink: %v", err)
|
||||
}
|
||||
if len(got) != 100 {
|
||||
t.Fatalf("size after shrink = %d, want 100", len(got))
|
||||
}
|
||||
if !bytes.Equal(got, original[:100]) {
|
||||
t.Fatal("the surviving prefix does not match the original")
|
||||
}
|
||||
|
||||
// Grow: the new space has to read back as zeros, not stale bytes.
|
||||
if err := os.Truncate(path, 8192); err != nil {
|
||||
t.Fatalf("truncate up: %v", err)
|
||||
}
|
||||
got, err = os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("read after grow: %v", err)
|
||||
}
|
||||
if len(got) != 8192 {
|
||||
t.Fatalf("size after grow = %d, want 8192", len(got))
|
||||
}
|
||||
if !bytes.Equal(got[100:], make([]byte, 8192-100)) {
|
||||
t.Fatal("extension is not zero-filled")
|
||||
}
|
||||
|
||||
// Truncate to empty.
|
||||
if err := os.Truncate(path, 0); err != nil {
|
||||
t.Fatalf("truncate to zero: %v", err)
|
||||
}
|
||||
if info, err := os.Stat(path); err != nil || info.Size() != 0 {
|
||||
t.Fatalf("stat after zero truncate: size=%v err=%v", info, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAppend(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "log")
|
||||
|
||||
for i := 0; i < 5; i++ {
|
||||
f, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
|
||||
if err != nil {
|
||||
t.Fatalf("open for append: %v", err)
|
||||
}
|
||||
if _, err := fmt.Fprintf(f, "line %d\n", i); err != nil {
|
||||
t.Fatalf("append: %v", err)
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
t.Fatalf("close: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
got, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("read: %v", err)
|
||||
}
|
||||
want := "line 0\nline 1\nline 2\nline 3\nline 4\n"
|
||||
if string(got) != want {
|
||||
t.Fatalf("appended content = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadPastEndOfFile(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "short")
|
||||
if err := os.WriteFile(path, []byte("12345"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
|
||||
f, err := os.Open(path)
|
||||
if err != nil {
|
||||
t.Fatalf("open: %v", err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
buf := make([]byte, 16)
|
||||
n, err := f.ReadAt(buf, 100)
|
||||
if n != 0 {
|
||||
t.Fatalf("read %d bytes past EOF, want 0", n)
|
||||
}
|
||||
if err == nil {
|
||||
t.Fatal("reading past EOF returned no error, want io.EOF")
|
||||
}
|
||||
}
|
||||
|
||||
func TestErrorPaths(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
|
||||
t.Run("open missing file", func(t *testing.T) {
|
||||
_, err := os.Open(filepath.Join(dir, "does-not-exist"))
|
||||
if !os.IsNotExist(err) {
|
||||
t.Fatalf("got %v, want a not-exist error", err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("exclusive create over existing", func(t *testing.T) {
|
||||
path := filepath.Join(dir, "taken")
|
||||
if err := os.WriteFile(path, []byte("x"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
_, err := os.OpenFile(path, os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0644)
|
||||
if !os.IsExist(err) {
|
||||
t.Fatalf("got %v, want an already-exists error", err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("remove missing file", func(t *testing.T) {
|
||||
if err := os.Remove(filepath.Join(dir, "never-there")); !os.IsNotExist(err) {
|
||||
t.Fatalf("got %v, want a not-exist error", err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("mkdir under a file", func(t *testing.T) {
|
||||
path := filepath.Join(dir, "regular")
|
||||
if err := os.WriteFile(path, []byte("x"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
if err := os.Mkdir(filepath.Join(path, "child"), 0755); err == nil {
|
||||
t.Fatal("created a directory underneath a regular file")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("readdir of a missing directory", func(t *testing.T) {
|
||||
if _, err := os.ReadDir(filepath.Join(dir, "no-such-dir")); err == nil {
|
||||
t.Fatal("listed a directory that does not exist")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestRenameOverExisting(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
src := filepath.Join(dir, "src")
|
||||
dst := filepath.Join(dir, "dst")
|
||||
|
||||
if err := os.WriteFile(src, []byte("new"), 0644); err != nil {
|
||||
t.Fatalf("write src: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(dst, []byte("old"), 0644); err != nil {
|
||||
t.Fatalf("write dst: %v", err)
|
||||
}
|
||||
if err := os.Rename(src, dst); err != nil {
|
||||
t.Fatalf("rename over existing: %v", err)
|
||||
}
|
||||
got, err := os.ReadFile(dst)
|
||||
if err != nil {
|
||||
t.Fatalf("read: %v", err)
|
||||
}
|
||||
if string(got) != "new" {
|
||||
t.Fatalf("target holds %q, want the source content", got)
|
||||
}
|
||||
if _, err := os.Stat(src); !os.IsNotExist(err) {
|
||||
t.Fatal("source survived the rename")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRenameAcrossDirectories(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
from := filepath.Join(dir, "from")
|
||||
to := filepath.Join(dir, "to")
|
||||
for _, d := range []string{from, to} {
|
||||
if err := os.Mkdir(d, 0755); err != nil {
|
||||
t.Fatalf("mkdir %s: %v", d, err)
|
||||
}
|
||||
}
|
||||
|
||||
src := filepath.Join(from, "file")
|
||||
dst := filepath.Join(to, "file")
|
||||
if err := os.WriteFile(src, []byte("moved"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
if err := os.Rename(src, dst); err != nil {
|
||||
t.Fatalf("rename across directories: %v", err)
|
||||
}
|
||||
got, err := os.ReadFile(dst)
|
||||
if err != nil {
|
||||
t.Fatalf("read: %v", err)
|
||||
}
|
||||
if string(got) != "moved" {
|
||||
t.Fatalf("content after move = %q", got)
|
||||
}
|
||||
|
||||
// A directory should move too, children and all.
|
||||
nested := filepath.Join(from, "sub")
|
||||
if err := os.Mkdir(nested, 0755); err != nil {
|
||||
t.Fatalf("mkdir sub: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(nested, "child"), []byte("c"), 0644); err != nil {
|
||||
t.Fatalf("write child: %v", err)
|
||||
}
|
||||
if err := os.Rename(nested, filepath.Join(to, "sub")); err != nil {
|
||||
t.Fatalf("rename directory: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(to, "sub", "child")); err != nil {
|
||||
t.Fatalf("child did not come along: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// TestAwkwardNames covers what has to survive the UTF-16 boundary and the
|
||||
// shapes Windows software tends to produce.
|
||||
func TestAwkwardNames(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
names := []string{
|
||||
"café.txt",
|
||||
"日本語のファイル.dat",
|
||||
"emoji-🐟.bin",
|
||||
"with space.txt",
|
||||
"with.many.dots.txt",
|
||||
"UPPER and lower.TXT",
|
||||
"dash-and_underscore.txt",
|
||||
"'quoted'.txt",
|
||||
"(parens).txt",
|
||||
"#hash&.txt",
|
||||
strings.Repeat("x", 200) + ".txt",
|
||||
}
|
||||
for _, name := range names {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
path := filepath.Join(dir, name)
|
||||
want := []byte(name)
|
||||
if err := os.WriteFile(path, want, 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
got, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("read: %v", err)
|
||||
}
|
||||
if !bytes.Equal(got, want) {
|
||||
t.Fatalf("content = %q, want %q", got, want)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
entries, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
t.Fatalf("readdir: %v", err)
|
||||
}
|
||||
found := make(map[string]bool, len(entries))
|
||||
for _, e := range entries {
|
||||
found[e.Name()] = true
|
||||
}
|
||||
for _, name := range names {
|
||||
if !found[name] {
|
||||
t.Errorf("%q did not come back from readdir", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeepDirectoryNesting(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
deep := dir
|
||||
for i := 0; i < 24; i++ {
|
||||
deep = filepath.Join(deep, fmt.Sprintf("level%02d", i))
|
||||
}
|
||||
if err := os.MkdirAll(deep, 0755); err != nil {
|
||||
t.Fatalf("mkdirall depth 24: %v", err)
|
||||
}
|
||||
leaf := filepath.Join(deep, "leaf.txt")
|
||||
if err := os.WriteFile(leaf, []byte("bottom"), 0644); err != nil {
|
||||
t.Fatalf("write leaf: %v", err)
|
||||
}
|
||||
got, err := os.ReadFile(leaf)
|
||||
if err != nil {
|
||||
t.Fatalf("read leaf: %v", err)
|
||||
}
|
||||
if string(got) != "bottom" {
|
||||
t.Fatalf("leaf content = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
// TestConcurrentSameFile is the interleaving that matters: several handles on
|
||||
// one file at once, rather than one writer each on separate files.
|
||||
func TestConcurrentSameFile(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "shared")
|
||||
|
||||
const writers = 4
|
||||
const blockSize = 4096
|
||||
if err := os.WriteFile(path, make([]byte, writers*blockSize), 0644); err != nil {
|
||||
t.Fatalf("preallocate: %v", err)
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
errs := make(chan error, writers)
|
||||
for w := 0; w < writers; w++ {
|
||||
wg.Add(1)
|
||||
go func(w int) {
|
||||
defer wg.Done()
|
||||
f, err := os.OpenFile(path, os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
errs <- fmt.Errorf("writer %d open: %w", w, err)
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
block := bytes.Repeat([]byte{byte('A' + w)}, blockSize)
|
||||
if _, err := f.WriteAt(block, int64(w*blockSize)); err != nil {
|
||||
errs <- fmt.Errorf("writer %d write: %w", w, err)
|
||||
}
|
||||
}(w)
|
||||
}
|
||||
wg.Wait()
|
||||
close(errs)
|
||||
for err := range errs {
|
||||
t.Fatalf("%v", err)
|
||||
}
|
||||
|
||||
got, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("read: %v", err)
|
||||
}
|
||||
if len(got) != writers*blockSize {
|
||||
t.Fatalf("size = %d, want %d", len(got), writers*blockSize)
|
||||
}
|
||||
for w := 0; w < writers; w++ {
|
||||
want := bytes.Repeat([]byte{byte('A' + w)}, blockSize)
|
||||
if !bytes.Equal(got[w*blockSize:(w+1)*blockSize], want) {
|
||||
t.Fatalf("block %d was not written whole", w)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestConcurrentReaders(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "read-me")
|
||||
want := contentFor("concurrent-readers", 1<<20)
|
||||
if err := os.WriteFile(path, want, 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
errs := make(chan error, 8)
|
||||
for r := 0; r < 8; r++ {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
got, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
errs <- err
|
||||
return
|
||||
}
|
||||
if !bytes.Equal(got, want) {
|
||||
errs <- fmt.Errorf("reader saw %d bytes, want %d", len(got), len(want))
|
||||
}
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
close(errs)
|
||||
for err := range errs {
|
||||
t.Fatalf("%v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Hard links are not something WinFsp offers, so the mount has to refuse them
|
||||
// rather than appear to succeed.
|
||||
func TestHardLinkUnsupported(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
target := filepath.Join(dir, "original")
|
||||
if err := os.WriteFile(target, []byte("x"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
if err := os.Link(target, filepath.Join(dir, "hardlink")); err == nil {
|
||||
t.Fatal("hard link creation reported success")
|
||||
}
|
||||
}
|
||||
|
||||
// Symlinks are refused rather than half-supported: WinFsp needs a reparse
|
||||
// point to follow one, and an entry it cannot follow reads back empty.
|
||||
func TestSymlinkUnsupported(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
target := filepath.Join(dir, "target.txt")
|
||||
if err := os.WriteFile(target, []byte("pointed at"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
if err := os.Symlink(target, filepath.Join(dir, "link.txt")); err == nil {
|
||||
t.Fatal("symlink creation reported success")
|
||||
}
|
||||
}
|
||||
|
||||
func TestModTimeAdvances(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "touched")
|
||||
if err := os.WriteFile(path, []byte("one"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
first, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatalf("stat: %v", err)
|
||||
}
|
||||
|
||||
time.Sleep(1100 * time.Millisecond)
|
||||
if err := os.WriteFile(path, []byte("two"), 0644); err != nil {
|
||||
t.Fatalf("rewrite: %v", err)
|
||||
}
|
||||
second, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatalf("stat again: %v", err)
|
||||
}
|
||||
if !second.ModTime().After(first.ModTime()) {
|
||||
t.Fatalf("mtime did not advance: %v then %v", first.ModTime(), second.ModTime())
|
||||
}
|
||||
}
|
||||
|
||||
func TestChtimes(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "dated")
|
||||
if err := os.WriteFile(path, []byte("x"), 0644); err != nil {
|
||||
t.Fatalf("write: %v", err)
|
||||
}
|
||||
want := time.Date(2020, 3, 4, 5, 6, 7, 0, time.UTC)
|
||||
if err := os.Chtimes(path, want, want); err != nil {
|
||||
t.Fatalf("chtimes: %v", err)
|
||||
}
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
t.Fatalf("stat: %v", err)
|
||||
}
|
||||
if diff := info.ModTime().UTC().Sub(want); diff > 2*time.Second || diff < -2*time.Second {
|
||||
t.Fatalf("mtime = %v, want about %v", info.ModTime().UTC(), want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStatfsIsSelfConsistent(t *testing.T) {
|
||||
if *mountPoint == "" {
|
||||
t.Skip("no -mountpoint given; this test needs a live WinFsp mount")
|
||||
}
|
||||
var free, total, totalFree uint64
|
||||
if err := getDiskFreeSpace(*mountPoint, &free, &total, &totalFree); err != nil {
|
||||
t.Fatalf("GetDiskFreeSpaceEx: %v", err)
|
||||
}
|
||||
if total == 0 {
|
||||
t.Fatal("drive reports zero total bytes")
|
||||
}
|
||||
if free > total {
|
||||
t.Fatalf("free (%d) exceeds total (%d)", free, total)
|
||||
}
|
||||
if totalFree > total {
|
||||
t.Fatalf("total free (%d) exceeds total (%d)", totalFree, total)
|
||||
}
|
||||
}
|
||||
|
||||
// TestDeleteOnClose covers the pattern Windows software uses for temporaries:
|
||||
// the file goes away when the last handle closes, with no explicit delete. A
|
||||
// filesystem that ignores the flag leaves the name behind, and the next
|
||||
// program to create it gets a collision.
|
||||
func TestDeleteOnClose(t *testing.T) {
|
||||
dir := testRoot(t)
|
||||
path := filepath.Join(dir, "ephemeral.tmp")
|
||||
|
||||
h, err := createDeleteOnClose(path)
|
||||
if err != nil {
|
||||
if errors.Is(err, errWindowsOnly) {
|
||||
t.Skip("delete-on-close needs the Win32 create call")
|
||||
}
|
||||
t.Fatalf("open with delete-on-close: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(path); err != nil {
|
||||
closeHandle(h)
|
||||
t.Fatalf("file is not visible while its handle is open: %v", err)
|
||||
}
|
||||
if err := closeHandle(h); err != nil {
|
||||
t.Fatalf("close: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
t.Fatal("file outlived its last handle")
|
||||
} else if !os.IsNotExist(err) {
|
||||
t.Fatalf("stat after close: %v", err)
|
||||
}
|
||||
// The name has to be free again, which is what the conformance suite
|
||||
// tripped over when an aborted test left its file behind.
|
||||
h, err = createDeleteOnClose(path)
|
||||
if err != nil {
|
||||
t.Fatalf("recreating the same name failed: %v", err)
|
||||
}
|
||||
if err := closeHandle(h); err != nil {
|
||||
t.Fatalf("close after recreate: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -310,7 +310,10 @@ func (s *AdminServer) SetBucketOwner(bucketName string, owner string) error {
|
||||
bucketEntry.Extended = make(map[string][]byte)
|
||||
}
|
||||
|
||||
// Set or remove the owner
|
||||
// Set or remove the owner. The account id recorded by the S3 API goes with
|
||||
// it: the S3 API derives it from the owning identity when it is absent, so
|
||||
// leaving the old one behind would keep the previous owner of the objects.
|
||||
delete(bucketEntry.Extended, s3_constants.ExtAmzOwnerKey)
|
||||
if owner == "" {
|
||||
delete(bucketEntry.Extended, s3_constants.AmzIdentityId)
|
||||
} else {
|
||||
|
||||
@@ -234,6 +234,7 @@ catalog = load_catalog(
|
||||
**{
|
||||
"type": "rest",
|
||||
"uri": "http://localhost:` + fmt.Sprintf("%d", data.IcebergPort) + `",
|
||||
"warehouse": "s3://my-table-bucket/",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -302,13 +302,14 @@ catalog = load_catalog(
|
||||
**{
|
||||
"type": "rest",
|
||||
"uri": "http://localhost:` + fmt.Sprintf("%d", data.IcebergPort) + `",
|
||||
"warehouse": "s3://my-table-bucket/",
|
||||
}
|
||||
)
|
||||
|
||||
# List namespaces
|
||||
namespaces = catalog.list_namespaces()`)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_catalog.templ`, Line: 241, Col: 39}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/iceberg_catalog.templ`, Line: 242, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
@@ -235,6 +235,7 @@ catalog = load_catalog(
|
||||
**{
|
||||
"type": "rest",
|
||||
"uri": "http://localhost:` + fmt.Sprintf("%d", data.IcebergPort) + `",
|
||||
"warehouse": "s3://my-table-bucket/",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -361,12 +361,13 @@ catalog = load_catalog(
|
||||
**{
|
||||
"type": "rest",
|
||||
"uri": "http://localhost:` + fmt.Sprintf("%d", data.IcebergPort) + `",
|
||||
"warehouse": "s3://my-table-bucket/",
|
||||
}
|
||||
)
|
||||
|
||||
namespaces = catalog.list_namespaces()`)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3tables_buckets.templ`, Line: 241, Col: 39}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3tables_buckets.templ`, Line: 242, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
@@ -39,6 +39,8 @@ type MountOptions struct {
|
||||
debugFuse *bool
|
||||
localSocket *string
|
||||
disableXAttr *bool
|
||||
windowsUid *int
|
||||
windowsGid *int
|
||||
extraOptions []string
|
||||
fuseCommandPid int
|
||||
|
||||
@@ -54,11 +56,11 @@ type MountOptions struct {
|
||||
rdmaTimeoutMs *int
|
||||
|
||||
// Peer chunk sharing options (design-weed-mount-peer-chunk-sharing.md).
|
||||
peerEnabled *bool
|
||||
peerListen *string
|
||||
peerAdvertise *string
|
||||
peerDataCenter *string
|
||||
peerRack *string
|
||||
peerEnabled *bool
|
||||
peerListen *string
|
||||
peerAdvertise *string
|
||||
peerDataCenter *string
|
||||
peerRack *string
|
||||
|
||||
dirIdleEvictSec *int
|
||||
|
||||
@@ -127,6 +129,8 @@ func init() {
|
||||
mountOptions.debugFuse = cmdMount.Flag.Bool("debug.fuse", false, "log raw FUSE protocol requests and responses")
|
||||
mountOptions.localSocket = cmdMount.Flag.String("localSocket", "", "default to /tmp/seaweedfs-mount-<mount_dir_hash>.sock")
|
||||
mountOptions.disableXAttr = cmdMount.Flag.Bool("disableXAttr", false, "disable xattr")
|
||||
mountOptions.windowsUid = cmdMount.Flag.Int("windows.uid", 0, "windows only: uid recorded on entries this mount creates, which other clients read")
|
||||
mountOptions.windowsGid = cmdMount.Flag.Int("windows.gid", 0, "windows only: gid recorded on entries this mount creates, which other clients read")
|
||||
mountOptions.hasAutofs = cmdMount.Flag.Bool("autofs", false, "ignore autofs mounted on the same mountpoint (useful when systemd.automount and autofs is used)")
|
||||
mountOptions.fuseCommandPid = 0
|
||||
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
//go:build linux || darwin || freebsd || windows
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/reflection"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/mount_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
"github.com/seaweedfs/seaweedfs/weed/security"
|
||||
"github.com/seaweedfs/seaweedfs/weed/storage/types"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util/grace"
|
||||
)
|
||||
|
||||
func runMount(cmd *Command, args []string) bool {
|
||||
|
||||
if *mountOptions.debug {
|
||||
go http.ListenAndServe(fmt.Sprintf(":%d", *mountOptions.debugPort), nil)
|
||||
}
|
||||
|
||||
*mountCpuProfile = util.ResolvePath(*mountCpuProfile)
|
||||
*mountMemProfile = util.ResolvePath(*mountMemProfile)
|
||||
grace.SetupProfiling(*mountCpuProfile, *mountMemProfile)
|
||||
if *mountReadRetryTime < time.Second {
|
||||
*mountReadRetryTime = time.Second
|
||||
}
|
||||
util.RetryWaitTime = *mountReadRetryTime
|
||||
|
||||
// 32 bits, not 64: os.FileMode is uint32, so a wider parse would let a
|
||||
// nonsense umask truncate silently instead of being rejected here.
|
||||
umask, umaskErr := strconv.ParseUint(*mountOptions.umaskString, 8, 32)
|
||||
if umaskErr != nil {
|
||||
fmt.Printf("can not parse umask %s", *mountOptions.umaskString)
|
||||
return false
|
||||
}
|
||||
|
||||
if len(args) > 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
return RunMount(&mountOptions, os.FileMode(umask))
|
||||
}
|
||||
|
||||
func ensureBucketAllowEmptyFolders(ctx context.Context, filerClient filer_pb.FilerClient, mountRoot, bucketRootPath string) error {
|
||||
bucketPath, isBucketRootMount := bucketPathForMountRoot(mountRoot, bucketRootPath)
|
||||
if !isBucketRootMount {
|
||||
return nil
|
||||
}
|
||||
|
||||
entry, _, _, err := filer_pb.GetEntry(ctx, filerClient, util.FullPath(bucketPath))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if entry == nil {
|
||||
return fmt.Errorf("bucket %s not found", bucketPath)
|
||||
}
|
||||
|
||||
if entry.Extended == nil {
|
||||
entry.Extended = make(map[string][]byte)
|
||||
}
|
||||
if strings.EqualFold(strings.TrimSpace(string(entry.Extended[s3_constants.ExtAllowEmptyFolders])), "true") {
|
||||
return nil
|
||||
}
|
||||
|
||||
entry.Extended[s3_constants.ExtAllowEmptyFolders] = []byte("true")
|
||||
|
||||
bucketFullPath := util.FullPath(bucketPath)
|
||||
parent, _ := bucketFullPath.DirAndName()
|
||||
if err := filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
|
||||
return filer_pb.UpdateEntry(ctx, client, &filer_pb.UpdateEntryRequest{
|
||||
Directory: parent,
|
||||
Entry: entry,
|
||||
})
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
glog.V(3).Infof("RunMount: set bucket %s %s=true", bucketPath, s3_constants.ExtAllowEmptyFolders)
|
||||
return nil
|
||||
}
|
||||
|
||||
func bucketPathForMountRoot(mountRoot, bucketRootPath string) (string, bool) {
|
||||
cleanPath := path.Clean("/" + strings.TrimPrefix(mountRoot, "/"))
|
||||
cleanBucketRoot := path.Clean("/" + strings.TrimPrefix(bucketRootPath, "/"))
|
||||
if cleanBucketRoot == "/" {
|
||||
return "", false
|
||||
}
|
||||
prefix := cleanBucketRoot + "/"
|
||||
if !strings.HasPrefix(cleanPath, prefix) {
|
||||
return "", false
|
||||
}
|
||||
rest := strings.TrimPrefix(cleanPath, prefix)
|
||||
|
||||
bucketParts := strings.Split(rest, "/")
|
||||
if len(bucketParts) != 1 || bucketParts[0] == "" {
|
||||
return "", false
|
||||
}
|
||||
return cleanBucketRoot + "/" + bucketParts[0], true
|
||||
}
|
||||
|
||||
func peerStringOrEmpty(p *string) string {
|
||||
if p == nil {
|
||||
return ""
|
||||
}
|
||||
return *p
|
||||
}
|
||||
|
||||
// connectToFiler retries the filer handshake, returning the cluster's cipher
|
||||
// setting and bucket root.
|
||||
func connectToFiler(option *MountOptions) (filerAddresses []pb.ServerAddress, grpcDialOption grpc.DialOption, cipher bool, bucketRootPath string, ok bool) {
|
||||
// try to connect to filer
|
||||
filerAddresses = pb.ServerAddresses(*option.filer).ToAddresses()
|
||||
util.LoadSecurityConfiguration()
|
||||
grpcDialOption = security.LoadClientTLS(util.GetViper(), "grpc.client")
|
||||
var err error
|
||||
for i := 0; i < 10; i++ {
|
||||
err = pb.WithOneOfGrpcFilerClients(false, filerAddresses, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("get filer grpc address %v configuration: %w", filerAddresses, err)
|
||||
}
|
||||
cipher = resp.Cipher
|
||||
bucketRootPath = resp.DirBuckets
|
||||
return nil
|
||||
})
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
glog.V(0).Infof("failed to talk to filer %v: %v", filerAddresses, err)
|
||||
glog.V(0).Infof("wait for %d seconds ...", i+1)
|
||||
time.Sleep(time.Duration(i+1) * time.Second)
|
||||
}
|
||||
if err != nil {
|
||||
glog.Errorf("failed to talk to filer %v: %v", filerAddresses, err)
|
||||
return nil, nil, false, "", false
|
||||
}
|
||||
if bucketRootPath == "" {
|
||||
bucketRootPath = "/buckets"
|
||||
}
|
||||
return filerAddresses, grpcDialOption, cipher, bucketRootPath, true
|
||||
}
|
||||
|
||||
// fileSystemParams are the pieces of a mount that each platform works out for
|
||||
// itself: where it is attached, and whose identity the entries carry.
|
||||
type fileSystemParams struct {
|
||||
dir string
|
||||
mountRoot string
|
||||
filerAddresses []pb.ServerAddress
|
||||
grpcDialOption grpc.DialOption
|
||||
cipher bool
|
||||
uidGidMapper *meta_cache.UidGidMapper
|
||||
uid uint32
|
||||
gid uint32
|
||||
mountMode os.FileMode
|
||||
mountCtime time.Time
|
||||
umask os.FileMode
|
||||
chunkSizeLimitMB int
|
||||
cacheDirForRead string
|
||||
cacheDirForWrite string
|
||||
}
|
||||
|
||||
func buildSeaweedFileSystem(option *MountOptions, p fileSystemParams) *mount.WFS {
|
||||
return mount.NewSeaweedFileSystem(&mount.Option{
|
||||
MountDirectory: p.dir,
|
||||
FilerAddresses: p.filerAddresses,
|
||||
GrpcDialOption: p.grpcDialOption,
|
||||
FilerSigningKey: security.SigningKey(util.GetViper().GetString("jwt.filer_signing.key")),
|
||||
FilerSigningExpiresAfterSec: util.GetViper().GetInt("jwt.filer_signing.expires_after_seconds"),
|
||||
FilerMountRootPath: p.mountRoot,
|
||||
Collection: *option.collection,
|
||||
Replication: *option.replication,
|
||||
TtlSec: int32(*option.ttlSec),
|
||||
DiskType: types.ToDiskType(*option.diskType),
|
||||
ChunkSizeLimit: int64(p.chunkSizeLimitMB) * 1024 * 1024,
|
||||
ConcurrentWriters: *option.concurrentWriters,
|
||||
ConcurrentReaders: *option.concurrentReaders,
|
||||
CacheDirForRead: p.cacheDirForRead,
|
||||
CacheSizeMBForRead: *option.cacheSizeMBForRead,
|
||||
CacheDirForWrite: p.cacheDirForWrite,
|
||||
WriteBufferSizeMB: *option.writeBufferSizeMB,
|
||||
CacheMetaTTlSec: *option.cacheMetaTtlSec,
|
||||
DataCenter: *option.dataCenter,
|
||||
Quota: int64(*option.collectionQuota) * 1024 * 1024,
|
||||
LogicalDiskUsage: *option.logicalDiskUsage,
|
||||
MountUid: p.uid,
|
||||
MountGid: p.gid,
|
||||
MountMode: p.mountMode,
|
||||
MountCtime: p.mountCtime,
|
||||
MountMtime: time.Now(),
|
||||
Umask: p.umask,
|
||||
VolumeServerAccess: *mountOptions.volumeServerAccess,
|
||||
Cipher: p.cipher,
|
||||
UidGidMapper: p.uidGidMapper,
|
||||
IncludeSystemEntries: *option.includeSystemEntries,
|
||||
DefaultPermissions: *option.defaultPermissions,
|
||||
DisableXAttr: *option.disableXAttr,
|
||||
IsMacOs: runtime.GOOS == "darwin",
|
||||
MetadataFlushSeconds: *option.metadataFlushSeconds,
|
||||
// RDMA acceleration options
|
||||
RdmaEnabled: *option.rdmaEnabled,
|
||||
RdmaSidecarAddr: *option.rdmaSidecarAddr,
|
||||
RdmaFallback: *option.rdmaFallback,
|
||||
RdmaReadOnly: *option.rdmaReadOnly,
|
||||
RdmaMaxConcurrent: *option.rdmaMaxConcurrent,
|
||||
RdmaTimeoutMs: *option.rdmaTimeoutMs,
|
||||
DirIdleEvictSec: *option.dirIdleEvictSec,
|
||||
EnableDistributedLock: option.distributedLock != nil && *option.distributedLock,
|
||||
WritebackCache: option.writebackCache != nil && *option.writebackCache,
|
||||
PosixDirNlink: option.posixDirNlink != nil && *option.posixDirNlink,
|
||||
// Peer chunk sharing
|
||||
PeerEnabled: option.peerEnabled != nil && *option.peerEnabled,
|
||||
PeerListen: peerStringOrEmpty(option.peerListen),
|
||||
PeerAdvertise: peerStringOrEmpty(option.peerAdvertise),
|
||||
PeerDataCenter: peerStringOrEmpty(option.peerDataCenter),
|
||||
PeerRack: peerStringOrEmpty(option.peerRack),
|
||||
})
|
||||
}
|
||||
|
||||
// createMountRoot makes the filer-side directory the mount is rooted at.
|
||||
func createMountRoot(wfs *mount.WFS, mountRoot, bucketRootPath string, filerAddresses []pb.ServerAddress) bool {
|
||||
mountRootPath := util.FullPath(mountRoot)
|
||||
mountRootParent, mountDir := mountRootPath.DirAndName()
|
||||
if err := filer_pb.Mkdir(context.Background(), wfs, mountRootParent, mountDir, nil); err != nil {
|
||||
fmt.Printf("failed to create dir %s on filer %s: %v\n", mountRoot, filerAddresses, err)
|
||||
return false
|
||||
}
|
||||
if err := ensureBucketAllowEmptyFolders(context.Background(), wfs, mountRoot, bucketRootPath); err != nil {
|
||||
fmt.Printf("failed to set bucket auto-remove-empty-folders policy for %s: %v\n", mountRoot, err)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// serveMountGrpc exposes the local control socket used by "weed mount.stats".
|
||||
func serveMountGrpc(wfs *mount.WFS, listener net.Listener) {
|
||||
grpcS := pb.NewGrpcServer()
|
||||
mount_pb.RegisterSeaweedMountServer(grpcS, wfs)
|
||||
reflection.Register(grpcS)
|
||||
go grpcS.Serve(listener)
|
||||
}
|
||||
|
||||
// resolveMountRoot trims the trailing slash the filer path must not carry.
|
||||
func resolveMountRoot(filerMountRootPath string) string {
|
||||
mountRoot := filerMountRootPath
|
||||
if mountRoot != "/" && strings.HasSuffix(mountRoot, "/") {
|
||||
mountRoot = mountRoot[0 : len(mountRoot)-1]
|
||||
}
|
||||
return mountRoot
|
||||
}
|
||||
|
||||
// resolveCacheDirs falls back to the read cache when no write cache is set.
|
||||
func resolveCacheDirs(option *MountOptions) (string, string) {
|
||||
cacheDirForRead := util.ResolvePath(*option.cacheDirForRead)
|
||||
cacheDirForWrite := util.ResolvePath(*option.cacheDirForWrite)
|
||||
if cacheDirForWrite == "" {
|
||||
cacheDirForWrite = cacheDirForRead
|
||||
}
|
||||
return cacheDirForRead, cacheDirForWrite
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !linux && !darwin && !freebsd
|
||||
//go:build !linux && !darwin && !freebsd && !windows
|
||||
|
||||
package command
|
||||
|
||||
|
||||
+21
-208
@@ -3,122 +3,26 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/user"
|
||||
"path"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/util/version"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount/unmount"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/mount_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
"github.com/seaweedfs/seaweedfs/weed/security"
|
||||
"github.com/seaweedfs/seaweedfs/weed/storage/types"
|
||||
"google.golang.org/grpc/reflection"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util/grace"
|
||||
)
|
||||
|
||||
func runMount(cmd *Command, args []string) bool {
|
||||
|
||||
if *mountOptions.debug {
|
||||
go http.ListenAndServe(fmt.Sprintf(":%d", *mountOptions.debugPort), nil)
|
||||
}
|
||||
|
||||
*mountCpuProfile = util.ResolvePath(*mountCpuProfile)
|
||||
*mountMemProfile = util.ResolvePath(*mountMemProfile)
|
||||
grace.SetupProfiling(*mountCpuProfile, *mountMemProfile)
|
||||
if *mountReadRetryTime < time.Second {
|
||||
*mountReadRetryTime = time.Second
|
||||
}
|
||||
util.RetryWaitTime = *mountReadRetryTime
|
||||
|
||||
umask, umaskErr := strconv.ParseUint(*mountOptions.umaskString, 8, 64)
|
||||
if umaskErr != nil {
|
||||
fmt.Printf("can not parse umask %s", *mountOptions.umaskString)
|
||||
return false
|
||||
}
|
||||
|
||||
if len(args) > 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
return RunMount(&mountOptions, os.FileMode(umask))
|
||||
}
|
||||
|
||||
func ensureBucketAllowEmptyFolders(ctx context.Context, filerClient filer_pb.FilerClient, mountRoot, bucketRootPath string) error {
|
||||
bucketPath, isBucketRootMount := bucketPathForMountRoot(mountRoot, bucketRootPath)
|
||||
if !isBucketRootMount {
|
||||
return nil
|
||||
}
|
||||
|
||||
entry, _, _, err := filer_pb.GetEntry(ctx, filerClient, util.FullPath(bucketPath))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if entry == nil {
|
||||
return fmt.Errorf("bucket %s not found", bucketPath)
|
||||
}
|
||||
|
||||
if entry.Extended == nil {
|
||||
entry.Extended = make(map[string][]byte)
|
||||
}
|
||||
if strings.EqualFold(strings.TrimSpace(string(entry.Extended[s3_constants.ExtAllowEmptyFolders])), "true") {
|
||||
return nil
|
||||
}
|
||||
|
||||
entry.Extended[s3_constants.ExtAllowEmptyFolders] = []byte("true")
|
||||
|
||||
bucketFullPath := util.FullPath(bucketPath)
|
||||
parent, _ := bucketFullPath.DirAndName()
|
||||
if err := filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
|
||||
return filer_pb.UpdateEntry(ctx, client, &filer_pb.UpdateEntryRequest{
|
||||
Directory: parent,
|
||||
Entry: entry,
|
||||
})
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
glog.V(3).Infof("RunMount: set bucket %s %s=true", bucketPath, s3_constants.ExtAllowEmptyFolders)
|
||||
return nil
|
||||
}
|
||||
|
||||
func bucketPathForMountRoot(mountRoot, bucketRootPath string) (string, bool) {
|
||||
cleanPath := path.Clean("/" + strings.TrimPrefix(mountRoot, "/"))
|
||||
cleanBucketRoot := path.Clean("/" + strings.TrimPrefix(bucketRootPath, "/"))
|
||||
if cleanBucketRoot == "/" {
|
||||
return "", false
|
||||
}
|
||||
prefix := cleanBucketRoot + "/"
|
||||
if !strings.HasPrefix(cleanPath, prefix) {
|
||||
return "", false
|
||||
}
|
||||
rest := strings.TrimPrefix(cleanPath, prefix)
|
||||
|
||||
bucketParts := strings.Split(rest, "/")
|
||||
if len(bucketParts) != 1 || bucketParts[0] == "" {
|
||||
return "", false
|
||||
}
|
||||
return cleanBucketRoot + "/" + bucketParts[0], true
|
||||
}
|
||||
|
||||
func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
|
||||
// basic checks
|
||||
@@ -128,36 +32,10 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// try to connect to filer
|
||||
filerAddresses := pb.ServerAddresses(*option.filer).ToAddresses()
|
||||
util.LoadSecurityConfiguration()
|
||||
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client")
|
||||
var cipher bool
|
||||
var bucketRootPath string
|
||||
var err error
|
||||
for i := 0; i < 10; i++ {
|
||||
err = pb.WithOneOfGrpcFilerClients(false, filerAddresses, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
resp, err := client.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("get filer grpc address %v configuration: %w", filerAddresses, err)
|
||||
}
|
||||
cipher = resp.Cipher
|
||||
bucketRootPath = resp.DirBuckets
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
glog.V(0).Infof("failed to talk to filer %v: %v", filerAddresses, err)
|
||||
glog.V(0).Infof("wait for %d seconds ...", i+1)
|
||||
time.Sleep(time.Duration(i+1) * time.Second)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
glog.Errorf("failed to talk to filer %v: %v", filerAddresses, err)
|
||||
filerAddresses, grpcDialOption, cipher, bucketRootPath, ok := connectToFiler(option)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
if bucketRootPath == "" {
|
||||
bucketRootPath = "/buckets"
|
||||
}
|
||||
|
||||
filerMountRootPath := *option.filerMountRootPath
|
||||
|
||||
@@ -316,82 +194,27 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
fuseMountOptions.EnableSymlinkCaching = true
|
||||
}
|
||||
|
||||
// find mount point
|
||||
mountRoot := filerMountRootPath
|
||||
if mountRoot != "/" && strings.HasSuffix(mountRoot, "/") {
|
||||
mountRoot = mountRoot[0 : len(mountRoot)-1]
|
||||
}
|
||||
mountRoot := resolveMountRoot(filerMountRootPath)
|
||||
cacheDirForRead, cacheDirForWrite := resolveCacheDirs(option)
|
||||
|
||||
cacheDirForRead := util.ResolvePath(*option.cacheDirForRead)
|
||||
cacheDirForWrite := util.ResolvePath(*option.cacheDirForWrite)
|
||||
if cacheDirForWrite == "" {
|
||||
cacheDirForWrite = cacheDirForRead
|
||||
}
|
||||
|
||||
seaweedFileSystem := mount.NewSeaweedFileSystem(&mount.Option{
|
||||
MountDirectory: dir,
|
||||
FilerAddresses: filerAddresses,
|
||||
GrpcDialOption: grpcDialOption,
|
||||
FilerSigningKey: security.SigningKey(util.GetViper().GetString("jwt.filer_signing.key")),
|
||||
FilerSigningExpiresAfterSec: util.GetViper().GetInt("jwt.filer_signing.expires_after_seconds"),
|
||||
FilerMountRootPath: mountRoot,
|
||||
Collection: *option.collection,
|
||||
Replication: *option.replication,
|
||||
TtlSec: int32(*option.ttlSec),
|
||||
DiskType: types.ToDiskType(*option.diskType),
|
||||
ChunkSizeLimit: int64(chunkSizeLimitMB) * 1024 * 1024,
|
||||
ConcurrentWriters: *option.concurrentWriters,
|
||||
ConcurrentReaders: *option.concurrentReaders,
|
||||
CacheDirForRead: cacheDirForRead,
|
||||
CacheSizeMBForRead: *option.cacheSizeMBForRead,
|
||||
CacheDirForWrite: cacheDirForWrite,
|
||||
WriteBufferSizeMB: *option.writeBufferSizeMB,
|
||||
CacheMetaTTlSec: *option.cacheMetaTtlSec,
|
||||
DataCenter: *option.dataCenter,
|
||||
Quota: int64(*option.collectionQuota) * 1024 * 1024,
|
||||
LogicalDiskUsage: *option.logicalDiskUsage,
|
||||
MountUid: uid,
|
||||
MountGid: gid,
|
||||
MountMode: mountMode,
|
||||
MountCtime: fileInfo.ModTime(),
|
||||
MountMtime: time.Now(),
|
||||
Umask: umask,
|
||||
VolumeServerAccess: *mountOptions.volumeServerAccess,
|
||||
Cipher: cipher,
|
||||
UidGidMapper: uidGidMapper,
|
||||
IncludeSystemEntries: *option.includeSystemEntries,
|
||||
DefaultPermissions: *option.defaultPermissions,
|
||||
DisableXAttr: *option.disableXAttr,
|
||||
IsMacOs: runtime.GOOS == "darwin",
|
||||
MetadataFlushSeconds: *option.metadataFlushSeconds,
|
||||
// RDMA acceleration options
|
||||
RdmaEnabled: *option.rdmaEnabled,
|
||||
RdmaSidecarAddr: *option.rdmaSidecarAddr,
|
||||
RdmaFallback: *option.rdmaFallback,
|
||||
RdmaReadOnly: *option.rdmaReadOnly,
|
||||
RdmaMaxConcurrent: *option.rdmaMaxConcurrent,
|
||||
RdmaTimeoutMs: *option.rdmaTimeoutMs,
|
||||
DirIdleEvictSec: *option.dirIdleEvictSec,
|
||||
EnableDistributedLock: option.distributedLock != nil && *option.distributedLock,
|
||||
WritebackCache: option.writebackCache != nil && *option.writebackCache,
|
||||
PosixDirNlink: option.posixDirNlink != nil && *option.posixDirNlink,
|
||||
// Peer chunk sharing
|
||||
PeerEnabled: option.peerEnabled != nil && *option.peerEnabled,
|
||||
PeerListen: peerStringOrEmpty(option.peerListen),
|
||||
PeerAdvertise: peerStringOrEmpty(option.peerAdvertise),
|
||||
PeerDataCenter: peerStringOrEmpty(option.peerDataCenter),
|
||||
PeerRack: peerStringOrEmpty(option.peerRack),
|
||||
seaweedFileSystem := buildSeaweedFileSystem(option, fileSystemParams{
|
||||
dir: dir,
|
||||
mountRoot: mountRoot,
|
||||
filerAddresses: filerAddresses,
|
||||
grpcDialOption: grpcDialOption,
|
||||
cipher: cipher,
|
||||
uidGidMapper: uidGidMapper,
|
||||
uid: uid,
|
||||
gid: gid,
|
||||
mountMode: mountMode,
|
||||
mountCtime: fileInfo.ModTime(),
|
||||
umask: umask,
|
||||
chunkSizeLimitMB: chunkSizeLimitMB,
|
||||
cacheDirForRead: cacheDirForRead,
|
||||
cacheDirForWrite: cacheDirForWrite,
|
||||
})
|
||||
|
||||
// create mount root
|
||||
mountRootPath := util.FullPath(mountRoot)
|
||||
mountRootParent, mountDir := mountRootPath.DirAndName()
|
||||
if err = filer_pb.Mkdir(context.Background(), seaweedFileSystem, mountRootParent, mountDir, nil); err != nil {
|
||||
fmt.Printf("failed to create dir %s on filer %s: %v\n", mountRoot, filerAddresses, err)
|
||||
return false
|
||||
}
|
||||
if err := ensureBucketAllowEmptyFolders(context.Background(), seaweedFileSystem, mountRoot, bucketRootPath); err != nil {
|
||||
fmt.Printf("failed to set bucket auto-remove-empty-folders policy for %s: %v\n", mountRoot, err)
|
||||
if !createMountRoot(seaweedFileSystem, mountRoot, bucketRootPath, filerAddresses) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -416,10 +239,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
}
|
||||
}
|
||||
|
||||
grpcS := pb.NewGrpcServer()
|
||||
mount_pb.RegisterSeaweedMountServer(grpcS, seaweedFileSystem)
|
||||
reflection.Register(grpcS)
|
||||
go grpcS.Serve(montSocketListener)
|
||||
serveMountGrpc(seaweedFileSystem, montSocketListener)
|
||||
|
||||
err = seaweedFileSystem.StartBackgroundTasks()
|
||||
if err != nil {
|
||||
@@ -440,10 +260,3 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func peerStringOrEmpty(p *string) string {
|
||||
if p == nil {
|
||||
return ""
|
||||
}
|
||||
return *p
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount/winfsp"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util/grace"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util/version"
|
||||
)
|
||||
|
||||
// ownedByMounter reports the mount root as belonging to whoever started it,
|
||||
// matching the uid=-1 option handed to WinFsp. It is a display value only:
|
||||
// WinFsp substitutes the calling user, and it must never be persisted, since
|
||||
// every other client would read the entry as owned by uid 4294967295.
|
||||
const ownedByMounter = ^uint32(0)
|
||||
|
||||
// windowsAttrTimeoutSec bounds how long WinFsp may serve cached attributes.
|
||||
// Nothing invalidates that cache from this side, so it stays short rather than
|
||||
// borrowing an unrelated flag's value.
|
||||
const windowsAttrTimeoutSec = 1.0
|
||||
|
||||
func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
chunkSizeLimitMB := *mountOptions.chunkSizeLimitMB
|
||||
if chunkSizeLimitMB <= 0 {
|
||||
fmt.Printf("Please specify a reasonable buffer size.\n")
|
||||
return false
|
||||
}
|
||||
|
||||
dir := *option.dir
|
||||
if dir == "" {
|
||||
fmt.Printf("Please specify the mount point via \"-dir\", for example -dir=S:\n")
|
||||
return false
|
||||
}
|
||||
// A drive letter or a not-yet-existing directory is what WinFsp wants, so
|
||||
// the mount point deliberately goes through none of the unix preparation:
|
||||
// no ResolvePath, no auto-create, no stat.
|
||||
if err := checkWindowsMountPoint(dir); err != nil {
|
||||
fmt.Printf("%v\n", err)
|
||||
return false
|
||||
}
|
||||
|
||||
filerAddresses, grpcDialOption, cipher, bucketRootPath, ok := connectToFiler(option)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
if *option.localSocket == "" {
|
||||
mountDirHash := util.HashToInt32([]byte(dir))
|
||||
if mountDirHash < 0 {
|
||||
mountDirHash = -mountDirHash
|
||||
}
|
||||
*option.localSocket = filepath.Join(os.TempDir(), fmt.Sprintf("seaweedfs-mount-%d.sock", mountDirHash))
|
||||
}
|
||||
if err := os.Remove(*option.localSocket); err != nil && !os.IsNotExist(err) {
|
||||
glog.Fatalf("Failed to remove %s, error: %s", *option.localSocket, err.Error())
|
||||
}
|
||||
mountSocketListener, err := net.Listen("unix", *option.localSocket)
|
||||
if err != nil {
|
||||
glog.Fatalf("Failed to listen on %s: %v", *option.localSocket, err)
|
||||
}
|
||||
|
||||
uidGidMapper, err := meta_cache.NewUidGidMapper(*option.uidMap, *option.gidMap)
|
||||
if err != nil {
|
||||
fmt.Printf("failed to parse %s %s: %v\n", *option.uidMap, *option.gidMap, err)
|
||||
return false
|
||||
}
|
||||
|
||||
mountRoot := resolveMountRoot(*option.filerMountRootPath)
|
||||
cacheDirForRead, cacheDirForWrite := resolveCacheDirs(option)
|
||||
|
||||
seaweedFileSystem := buildSeaweedFileSystem(option, fileSystemParams{
|
||||
dir: dir,
|
||||
mountRoot: mountRoot,
|
||||
filerAddresses: filerAddresses,
|
||||
grpcDialOption: grpcDialOption,
|
||||
cipher: cipher,
|
||||
uidGidMapper: uidGidMapper,
|
||||
uid: uint32(*option.windowsUid),
|
||||
gid: uint32(*option.windowsGid),
|
||||
mountMode: os.ModeDir | 0777,
|
||||
mountCtime: time.Now(),
|
||||
umask: umask,
|
||||
chunkSizeLimitMB: chunkSizeLimitMB,
|
||||
cacheDirForRead: cacheDirForRead,
|
||||
cacheDirForWrite: cacheDirForWrite,
|
||||
})
|
||||
|
||||
if !createMountRoot(seaweedFileSystem, mountRoot, bucketRootPath, filerAddresses) {
|
||||
return false
|
||||
}
|
||||
|
||||
host := winfsp.New(seaweedFileSystem, winfsp.Options{
|
||||
VolumeName: strings.ReplaceAll(*option.filer, ",", "+"),
|
||||
Uid: ownedByMounter,
|
||||
Gid: ownedByMounter,
|
||||
AttrTimeout: windowsAttrTimeoutSec,
|
||||
ReadOnly: *option.readOnly,
|
||||
Debug: *option.debugFuse,
|
||||
ExtraOptions: option.extraOptions,
|
||||
})
|
||||
|
||||
// Windows caches entries on its own side and the mount cannot invalidate
|
||||
// that cache directly, so changes made elsewhere have to be pushed out.
|
||||
host.Notify(seaweedFileSystem)
|
||||
|
||||
grace.OnInterrupt(func() {
|
||||
// The signal handler exits the process as soon as the hooks return, so
|
||||
// anything still queued has to be flushed here rather than after Serve.
|
||||
// WaitForAsyncFlush is idempotent, so the post-Serve call below is
|
||||
// harmless if both run.
|
||||
host.Unmount()
|
||||
seaweedFileSystem.WaitForAsyncFlush()
|
||||
})
|
||||
|
||||
serveMountGrpc(seaweedFileSystem, mountSocketListener)
|
||||
|
||||
if err := seaweedFileSystem.StartBackgroundTasks(); err != nil {
|
||||
fmt.Printf("failed to start background tasks: %v\n", err)
|
||||
return false
|
||||
}
|
||||
|
||||
glog.V(0).Infof("mounting %s%s to %v", *option.filer, mountRoot, dir)
|
||||
glog.V(0).Infof("This is SeaweedFS version %s %s %s", version.Version(), runtime.GOOS, runtime.GOARCH)
|
||||
glog.V(0).Infof("Windows mount is beta: hard links are unavailable and byte-range locks are not shared across mounts")
|
||||
|
||||
if err := host.Serve(windowsMountPoint(dir)); err != nil {
|
||||
glog.Errorf("%v", err)
|
||||
return false
|
||||
}
|
||||
|
||||
seaweedFileSystem.WaitForAsyncFlush()
|
||||
seaweedFileSystem.ClearCacheDir()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// checkWindowsMountPoint rejects the mount points WinFsp cannot take, which is
|
||||
// worth doing up front because its own failure is a bare false.
|
||||
func checkWindowsMountPoint(dir string) error {
|
||||
if isDriveLetter(dir) {
|
||||
if _, err := os.Stat(strings.TrimRight(dir, `\/`) + `\`); err == nil {
|
||||
return fmt.Errorf("drive %s is already in use", dir)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(dir, `\\`) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// WinFsp creates the directory itself, with FILE_CREATE, and deletes it
|
||||
// again when the filesystem goes away. An existing one — empty or not —
|
||||
// fails with "mount point in use".
|
||||
if _, err := os.Stat(dir); err == nil {
|
||||
return fmt.Errorf("mount point %s already exists; WinFsp creates the directory itself, so give it a path that does not exist yet", dir)
|
||||
} else if !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
if _, err := os.Stat(filepath.Dir(dir)); err != nil {
|
||||
return fmt.Errorf("parent of mount point %s does not exist", dir)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// windowsMountPoint drops a trailing separator from a drive letter. WinFsp
|
||||
// recognises a drive only as exactly two characters; "S:\\" falls through to
|
||||
// its directory handling and the mount fails.
|
||||
func windowsMountPoint(dir string) string {
|
||||
if isDriveLetter(dir) {
|
||||
return strings.TrimRight(dir, `\/`)
|
||||
}
|
||||
return dir
|
||||
}
|
||||
|
||||
// isDriveLetter accepts both "S:" and "S:\\"; the trailing separator is how
|
||||
// the drive is usually written, and windowsMountPoint normalises it.
|
||||
func isDriveLetter(dir string) bool {
|
||||
trimmed := strings.TrimRight(dir, `\/`)
|
||||
if len(trimmed) != 2 || trimmed[1] != ':' {
|
||||
return false
|
||||
}
|
||||
c := trimmed[0]
|
||||
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package filer
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
@@ -159,6 +160,51 @@ func (entry *Entry) IsExpireS3Enabled() (exist bool) {
|
||||
return exist
|
||||
}
|
||||
|
||||
func (entry *Entry) isS3Entry() bool {
|
||||
if entry.Extended == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if _, found := entry.Extended[s3_constants.ExtAmzOwnerKey]; found {
|
||||
return true
|
||||
}
|
||||
|
||||
if _, found := entry.Extended[s3_constants.ExtETagKey]; found {
|
||||
return true
|
||||
}
|
||||
|
||||
for key := range entry.Extended {
|
||||
if strings.HasPrefix(key, s3_constants.ExtAmzPrefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (entry *Entry) ApplyS3ExpiryMetadata() {
|
||||
if entry.TtlSec == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if _, found := entry.Extended[s3_constants.SeaweedFSExpiresS3]; found {
|
||||
return
|
||||
}
|
||||
|
||||
// The s3 expiry path skips versioned entries, so stamping one would drop its
|
||||
// expiry entirely instead of moving it onto mtime.
|
||||
if entry.IsS3Versioning() {
|
||||
return
|
||||
}
|
||||
|
||||
if !entry.isS3Entry() {
|
||||
return
|
||||
}
|
||||
|
||||
entry.Extended[s3_constants.SeaweedFSExpiresS3] = []byte("true")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (entry *Entry) IsS3Versioning() (exist bool) {
|
||||
if entry.Extended != nil {
|
||||
_, exist = entry.Extended[s3_constants.ExtVersionIdKey]
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package filer
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
)
|
||||
|
||||
func TestApplyS3ExpiryMetadata(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
ttlSec int32
|
||||
extended map[string][]byte
|
||||
want bool
|
||||
}{
|
||||
{
|
||||
name: "s3 entry with ttl",
|
||||
ttlSec: 3600,
|
||||
extended: map[string][]byte{s3_constants.ExtETagKey: []byte("abc123")},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "no ttl",
|
||||
extended: map[string][]byte{s3_constants.ExtETagKey: []byte("abc123")},
|
||||
},
|
||||
{
|
||||
name: "not an s3 entry",
|
||||
ttlSec: 3600,
|
||||
},
|
||||
{
|
||||
name: "versioned entry keeps crtime expiry",
|
||||
ttlSec: 3600,
|
||||
extended: map[string][]byte{
|
||||
s3_constants.ExtETagKey: []byte("abc123"),
|
||||
s3_constants.ExtVersionIdKey: []byte("v1"),
|
||||
},
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
entry := &Entry{Attr: Attr{TtlSec: tc.ttlSec}, Extended: tc.extended}
|
||||
entry.ApplyS3ExpiryMetadata()
|
||||
if got := entry.IsExpireS3Enabled(); got != tc.want {
|
||||
t.Fatalf("IsExpireS3Enabled() = %v, want %v", got, tc.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package iamapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/seaweedfs/seaweedfs/weed/credential"
|
||||
"github.com/seaweedfs/seaweedfs/weed/credential/memory"
|
||||
"github.com/seaweedfs/seaweedfs/weed/filer"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/iam_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// A data-plane identity holding nothing but the equivalent of AmazonS3FullAccess,
|
||||
// and an admin, so the same request can be run from both sides. The admin key is
|
||||
// obviously fake to keep secret scanners quiet.
|
||||
const authzConfigJSON = `{
|
||||
"identities": [
|
||||
{
|
||||
"name": "power_user",
|
||||
"credentials": [{"accessKey": "AKIAIOSFODNN7EXAMPLE", "secretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}],
|
||||
"policyNames": ["PowerUserPolicy"]
|
||||
},
|
||||
{
|
||||
"name": "iam_admin",
|
||||
"credentials": [{"accessKey": "AKIATESTFAKEADMIN0001", "secretKey": "testAdminSecretFake0000000000000000000000"}],
|
||||
"actions": ["Admin"]
|
||||
}
|
||||
],
|
||||
"policies": [
|
||||
{
|
||||
"name": "PowerUserPolicy",
|
||||
"content": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"s3:*\",\"Resource\":\"*\"}]}"
|
||||
}
|
||||
]
|
||||
}`
|
||||
|
||||
func newAuthzTestServer(t *testing.T) *httptest.Server {
|
||||
t.Helper()
|
||||
|
||||
config := &iam_pb.S3ApiConfiguration{}
|
||||
require.NoError(t, filer.ParseS3ConfigurationFromBytes([]byte(authzConfigJSON), config))
|
||||
|
||||
store := &memory.MemoryStore{}
|
||||
require.NoError(t, store.Initialize(nil, ""))
|
||||
cm := &credential.CredentialManager{Store: store}
|
||||
require.NoError(t, cm.SaveConfiguration(context.Background(), config))
|
||||
|
||||
iam := &s3api.IdentityAccessManagement{}
|
||||
iam.SetCredentialManagerForTest(cm)
|
||||
require.NoError(t, iam.LoadS3ApiConfigurationFromBytes([]byte(authzConfigJSON)))
|
||||
|
||||
iama := &IamApiServer{
|
||||
iam: iam,
|
||||
s3ApiConfig: &countingConfigSaver{cm: cm},
|
||||
}
|
||||
router := mux.NewRouter().SkipClean(true)
|
||||
iama.registerRouter(router)
|
||||
|
||||
server := httptest.NewServer(router)
|
||||
t.Cleanup(server.Close)
|
||||
return server
|
||||
}
|
||||
|
||||
func postSignedIamAction(t *testing.T, serverURL, accessKey, secretKey, rawQuery, body string) *http.Response {
|
||||
t.Helper()
|
||||
|
||||
url := serverURL + "/"
|
||||
if rawQuery != "" {
|
||||
url += "?" + rawQuery
|
||||
}
|
||||
req, err := http.NewRequest(http.MethodPost, url, strings.NewReader(body))
|
||||
require.NoError(t, err)
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
|
||||
payloadHash := fmt.Sprintf("%x", sha256.Sum256([]byte(body)))
|
||||
require.NoError(t, v4.NewSigner().SignHTTP(context.Background(),
|
||||
aws.Credentials{AccessKeyID: accessKey, SecretAccessKey: secretKey},
|
||||
req, payloadHash, "iam", "us-east-1", time.Now()))
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() { resp.Body.Close() })
|
||||
return resp
|
||||
}
|
||||
|
||||
// An S3 data-plane policy grants no IAM management, however broad it is: the
|
||||
// standalone server used to check these actions as a coarse S3 action, which
|
||||
// such a policy matches.
|
||||
func TestIamManagementDeniedForDataPlanePolicy(t *testing.T) {
|
||||
server := newAuthzTestServer(t)
|
||||
|
||||
for _, action := range []string{"CreateUser", "CreateAccessKey", "PutUserPolicy", "AttachUserPolicy"} {
|
||||
t.Run(action, func(t *testing.T) {
|
||||
resp := postSignedIamAction(t, server.URL, "AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
||||
"", "Action="+action+"&UserName=victim&Version=2010-05-08")
|
||||
assert.Equal(t, http.StatusForbidden, resp.StatusCode)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Same expectation when the request carries an S3 query parameter, which the
|
||||
// action resolver used to read even for an IAM action.
|
||||
func TestIamManagementDeniedWithS3QueryParameter(t *testing.T) {
|
||||
server := newAuthzTestServer(t)
|
||||
|
||||
for _, rawQuery := range []string{"delete", "acl", "tagging", "policy"} {
|
||||
t.Run(rawQuery, func(t *testing.T) {
|
||||
resp := postSignedIamAction(t, server.URL, "AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
||||
rawQuery, "Action=CreateUser&UserName=victim&Version=2010-05-08")
|
||||
assert.Equal(t, http.StatusForbidden, resp.StatusCode)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Self-service still works without an IAM grant, matching AWS and the embedded
|
||||
// IAM surface: a user may rotate its own access keys.
|
||||
func TestIamSelfServiceAllowedForDataPlanePolicy(t *testing.T) {
|
||||
server := newAuthzTestServer(t)
|
||||
|
||||
resp := postSignedIamAction(t, server.URL, "AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
||||
"", "Action=ListAccessKeys&Version=2010-05-08")
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
}
|
||||
|
||||
func TestIamManagementAllowedForAdmin(t *testing.T) {
|
||||
server := newAuthzTestServer(t)
|
||||
|
||||
resp := postSignedIamAction(t, server.URL, "AKIATESTFAKEADMIN0001", "testAdminSecretFake0000000000000000000000",
|
||||
"", "Action=CreateUser&UserName=new-user&Version=2010-05-08")
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/iam_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/policy_engine"
|
||||
. "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
|
||||
@@ -124,10 +123,7 @@ func (iama *IamApiServer) registerRouter(router *mux.Router) {
|
||||
// API Router
|
||||
apiRouter := router.PathPrefix("/").Subrouter()
|
||||
apiRouter.Use(request_id.Middleware)
|
||||
// ListBuckets
|
||||
|
||||
// apiRouter.Methods("GET").Path("/").HandlerFunc(track(s3a.iam.Auth(s3a.ListBucketsHandler, ACTION_ADMIN), "LIST"))
|
||||
apiRouter.Methods(http.MethodPost).Path("/").HandlerFunc(iama.iam.Auth(iama.DoActions, ACTION_ADMIN))
|
||||
apiRouter.Methods(http.MethodPost).Path("/").HandlerFunc(iama.iam.AuthIamManagement(iama.DoActions))
|
||||
|
||||
// Health probes
|
||||
apiRouter.Methods(http.MethodGet, http.MethodHead).Path("/healthz").HandlerFunc(iama.healthzHandler)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package mount
|
||||
|
||||
import (
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
)
|
||||
|
||||
// DirEntrySink receives the entries a readdir produces. The FUSE server packs
|
||||
// them straight into the kernel's reply buffer; a front end that is not the
|
||||
// kernel reads them out instead of re-parsing that wire format.
|
||||
type DirEntrySink interface {
|
||||
// AddEntry reports one entry, returning false once the sink is full. A
|
||||
// full sink ends the batch; the client resumes from the entry's Off.
|
||||
AddEntry(entry fuse.DirEntry) bool
|
||||
|
||||
// AddEntryPlus is AddEntry for readdirplus, returning the attribute block
|
||||
// to fill in, or nil once the sink is full.
|
||||
AddEntryPlus(entry fuse.DirEntry) *fuse.EntryOut
|
||||
}
|
||||
|
||||
// fuseDirEntryList adapts the kernel reply buffer to DirEntrySink.
|
||||
type fuseDirEntryList struct {
|
||||
*fuse.DirEntryList
|
||||
}
|
||||
|
||||
func (l fuseDirEntryList) AddEntry(entry fuse.DirEntry) bool {
|
||||
return l.AddDirEntry(entry)
|
||||
}
|
||||
|
||||
func (l fuseDirEntryList) AddEntryPlus(entry fuse.DirEntry) *fuse.EntryOut {
|
||||
return l.AddDirLookupEntry(entry)
|
||||
}
|
||||
|
||||
// ReadDirectoryInto runs a readdir against sink. ReadDir and ReadDirPlus are
|
||||
// this with the kernel reply buffer as the sink.
|
||||
func (wfs *WFS) ReadDirectoryInto(input *fuse.ReadIn, sink DirEntrySink, isPlusMode bool) fuse.Status {
|
||||
return wfs.doReadDirectory(input, sink, isPlusMode)
|
||||
}
|
||||
@@ -20,7 +20,7 @@ func TestFileHandleFullPathFallsBackAfterForget(t *testing.T) {
|
||||
}
|
||||
fh.RememberPath(fullPath)
|
||||
|
||||
wfs.inodeToPath.Forget(inode, 1, nil)
|
||||
wfs.inodeToPath.Forget(inode, 1, nil, nil)
|
||||
|
||||
if got := fh.FullPath(); got != fullPath {
|
||||
t.Fatalf("FullPath() after forget = %q, want %q", got, fullPath)
|
||||
@@ -44,7 +44,7 @@ func TestFileHandleFullPathUsesSavedRenamePathAfterForget(t *testing.T) {
|
||||
|
||||
wfs.inodeToPath.MovePath(oldPath, newPath)
|
||||
fh.RememberPath(newPath)
|
||||
wfs.inodeToPath.Forget(inode, 1, nil)
|
||||
wfs.inodeToPath.Forget(inode, 1, nil, nil)
|
||||
|
||||
if got := fh.FullPath(); got != newPath {
|
||||
t.Fatalf("FullPath() after rename+forget = %q, want %q", got, newPath)
|
||||
|
||||
@@ -510,7 +510,11 @@ func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (sourceInod
|
||||
return
|
||||
}
|
||||
|
||||
func (i *InodeToPath) Forget(inode, nlookup uint64, onForgetDir func(dir util.FullPath)) {
|
||||
// Forget drops nlookup references. onRelease, if given, runs at the moment the
|
||||
// inode is released and while the table is still locked: state keyed by the
|
||||
// inode number has to be dropped there, because the number is derived from the
|
||||
// path and a lookup arriving after the unlock would be handed the same one.
|
||||
func (i *InodeToPath) Forget(inode, nlookup uint64, onRelease func(inode uint64), onForgetDir func(dir util.FullPath)) {
|
||||
var dirPaths []util.FullPath
|
||||
callOnForgetDir := false
|
||||
|
||||
@@ -525,6 +529,9 @@ func (i *InodeToPath) Forget(inode, nlookup uint64, onForgetDir func(dir util.Fu
|
||||
}
|
||||
glog.V(4).Infof("kernel forget: inode %d paths %v nlookup %d", inode, path.paths, path.nlookup)
|
||||
if path.nlookup == 0 {
|
||||
if onRelease != nil {
|
||||
onRelease(inode)
|
||||
}
|
||||
if _, isDir := i.dirStates[inode]; isDir && onForgetDir != nil {
|
||||
dirPaths = append([]util.FullPath(nil), path.paths...)
|
||||
callOnForgetDir = true
|
||||
|
||||
@@ -120,7 +120,7 @@ func TestOnlyDirectoriesGetDirState(t *testing.T) {
|
||||
}
|
||||
|
||||
// forgetting the directory drops its dirState
|
||||
itp.Forget(dirInode, 1, nil)
|
||||
itp.Forget(dirInode, 1, nil, nil)
|
||||
if _, ok := itp.dirStates[dirInode]; ok {
|
||||
t.Fatal("forgotten directory must be removed from dirStates")
|
||||
}
|
||||
@@ -165,3 +165,37 @@ func TestMarkChildrenCachedClearsReadThroughMode(t *testing.T) {
|
||||
t.Fatal("directory should leave read-through mode after caching")
|
||||
}
|
||||
}
|
||||
|
||||
// State keyed by an inode number has to be dropped while the table is locked.
|
||||
// The numbers come from the path, so a lookup racing a forget is handed the
|
||||
// same one back, and a cleanup running after the unlock would wipe what that
|
||||
// lookup just stored.
|
||||
func TestForgetOnReleaseRunsUnderLock(t *testing.T) {
|
||||
itp := NewInodeToPath(util.FullPath("/"), 60)
|
||||
file := util.FullPath("/data/f.txt")
|
||||
inode := itp.Lookup(file, time.Now().Unix(), false, false, 0, true)
|
||||
|
||||
itp.Lookup(file, time.Now().Unix(), false, false, 0, true) // nlookup is 2 now
|
||||
|
||||
calls := 0
|
||||
onRelease := func(released uint64) {
|
||||
calls++
|
||||
if released != inode {
|
||||
t.Errorf("released inode = %d, want %d", released, inode)
|
||||
}
|
||||
if itp.TryLock() {
|
||||
itp.Unlock()
|
||||
t.Error("onRelease ran outside the critical section")
|
||||
}
|
||||
}
|
||||
|
||||
itp.Forget(inode, 1, onRelease, nil)
|
||||
if calls != 0 {
|
||||
t.Fatalf("partial forget must not release: onRelease called %d times", calls)
|
||||
}
|
||||
|
||||
itp.Forget(inode, 1, onRelease, nil)
|
||||
if calls != 1 {
|
||||
t.Fatalf("onRelease called %d times, want 1", calls)
|
||||
}
|
||||
}
|
||||
@@ -795,6 +795,10 @@ type EntryInvalidation struct {
|
||||
// Signatures from the event. The filer that logged it appends its own, so
|
||||
// this identifies the clock domain TsNs belongs to.
|
||||
Signatures []int32
|
||||
// WasDirectory records what used to be at a vacated path. Entry is nil
|
||||
// once the path is empty, so this is the only thing left saying whether a
|
||||
// directory or a file went away.
|
||||
WasDirectory bool
|
||||
}
|
||||
|
||||
type metadataResponseSideEffects struct {
|
||||
@@ -1250,7 +1254,7 @@ func collectEntryInvalidations(resp *filer_pb.SubscribeMetadataResponse) []Entry
|
||||
}
|
||||
if message.OldEntry.Name != message.NewEntry.Name || resp.Directory != newDir {
|
||||
newKey := util.NewFullPath(newDir, message.NewEntry.Name)
|
||||
invalidations = append(invalidations, EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Signatures: signatures, RenamedTo: newKey})
|
||||
invalidations = append(invalidations, EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Signatures: signatures, RenamedTo: newKey, WasDirectory: message.OldEntry.IsDirectory})
|
||||
invalidations = append(invalidations, EntryInvalidation{Path: newKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures})
|
||||
} else {
|
||||
invalidations = append(invalidations, EntryInvalidation{Path: oldKey, Entry: message.NewEntry, TsNs: resp.TsNs, Signatures: signatures})
|
||||
@@ -1269,7 +1273,7 @@ func collectEntryInvalidations(resp *filer_pb.SubscribeMetadataResponse) []Entry
|
||||
|
||||
if filer_pb.IsDelete(resp) && message.OldEntry != nil {
|
||||
oldKey := util.NewFullPath(resp.Directory, message.OldEntry.Name)
|
||||
invalidations = append(invalidations, EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Deleted: true, Signatures: signatures})
|
||||
invalidations = append(invalidations, EntryInvalidation{Path: oldKey, TsNs: resp.TsNs, Deleted: true, Signatures: signatures, WasDirectory: message.OldEntry.IsDirectory})
|
||||
}
|
||||
|
||||
return invalidations
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"math"
|
||||
"sort"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ import (
|
||||
type lockRange struct {
|
||||
Start uint64 // inclusive byte offset
|
||||
End uint64 // inclusive; math.MaxUint64 means "to EOF"
|
||||
Typ uint32 // syscall.F_RDLCK or syscall.F_WRLCK
|
||||
Typ uint32 // f_RDLCK or f_WRLCK
|
||||
Owner uint64 // FUSE lock owner (from LkIn.Owner)
|
||||
Pid uint32 // PID of lock holder (for GetLk reporting)
|
||||
// flock and fcntl locks have different ownership and close semantics.
|
||||
@@ -127,7 +126,7 @@ func findConflict(locks []lockRange, proposed lockRange) (lockRange, bool) {
|
||||
if !rangesOverlap(h.Start, h.End, proposed.Start, proposed.End) {
|
||||
continue
|
||||
}
|
||||
if h.Typ == syscall.F_RDLCK && proposed.Typ == syscall.F_RDLCK {
|
||||
if h.Typ == f_RDLCK && proposed.Typ == f_RDLCK {
|
||||
continue
|
||||
}
|
||||
return h, true
|
||||
@@ -304,7 +303,7 @@ func (plt *PosixLockTable) GetLk(inode uint64, proposed lockRange, out *fuse.LkO
|
||||
for {
|
||||
il := plt.getInodeLocks(inode)
|
||||
if il == nil {
|
||||
out.Lk.Typ = syscall.F_UNLCK
|
||||
out.Lk.Typ = f_UNLCK
|
||||
return
|
||||
}
|
||||
il.mu.Lock()
|
||||
@@ -324,7 +323,7 @@ func (plt *PosixLockTable) GetLk(inode uint64, proposed lockRange, out *fuse.LkO
|
||||
out.Lk.Typ = conflict.Typ
|
||||
out.Lk.Pid = conflict.Pid
|
||||
} else {
|
||||
out.Lk.Typ = syscall.F_UNLCK
|
||||
out.Lk.Typ = f_UNLCK
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -334,7 +333,7 @@ func (plt *PosixLockTable) GetLk(inode uint64, proposed lockRange, out *fuse.LkO
|
||||
// For unlock (F_UNLCK): removes locks in the given range for the owner.
|
||||
// For lock: returns fuse.EAGAIN if a conflict exists, fuse.OK on success.
|
||||
func (plt *PosixLockTable) SetLk(inode uint64, lk lockRange) fuse.Status {
|
||||
if lk.Typ == syscall.F_UNLCK {
|
||||
if lk.Typ == f_UNLCK {
|
||||
il := plt.getInodeLocks(inode)
|
||||
if il == nil {
|
||||
return fuse.OK
|
||||
@@ -376,7 +375,7 @@ func (plt *PosixLockTable) SetLk(inode uint64, lk lockRange) fuse.Status {
|
||||
// SetLkw attempts a blocking lock. It waits until the lock can be acquired
|
||||
// or the cancel channel is closed.
|
||||
func (plt *PosixLockTable) SetLkw(inode uint64, lk lockRange, cancel <-chan struct{}) fuse.Status {
|
||||
if lk.Typ == syscall.F_UNLCK {
|
||||
if lk.Typ == f_UNLCK {
|
||||
return plt.SetLk(inode, lk)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//go:build !windows
|
||||
|
||||
package mount
|
||||
|
||||
import (
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//go:build !windows
|
||||
|
||||
package mount
|
||||
|
||||
import "syscall"
|
||||
|
||||
const (
|
||||
f_RDLCK = syscall.F_RDLCK
|
||||
f_WRLCK = syscall.F_WRLCK
|
||||
f_UNLCK = syscall.F_UNLCK
|
||||
o_ACCMODE = syscall.O_ACCMODE
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
package mount
|
||||
|
||||
// Windows has no fcntl lock types and no access-mode mask. The Linux values
|
||||
// stand in: nothing on Windows feeds these, and the lock table only ever
|
||||
// compares them against each other.
|
||||
const (
|
||||
f_RDLCK = 0
|
||||
f_WRLCK = 1
|
||||
f_UNLCK = 2
|
||||
o_ACCMODE = 0x3
|
||||
|
||||
xattr_CREATE = 1
|
||||
xattr_REPLACE = 2
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
package mount
|
||||
|
||||
import "testing"
|
||||
|
||||
// The Windows adapter forwards cgofuse's xattr flags to SetXAttr untouched,
|
||||
// which only holds while both sides number them the same. cgofuse's side is
|
||||
// pinned in weed/mount/winfsp; this pins ours, so editing either alone fails
|
||||
// rather than silently turning a create into a replace.
|
||||
func TestXattrFlagValues(t *testing.T) {
|
||||
if xattr_CREATE != 1 {
|
||||
t.Errorf("xattr_CREATE = %d, want 1", xattr_CREATE)
|
||||
}
|
||||
if xattr_REPLACE != 2 {
|
||||
t.Errorf("xattr_REPLACE = %d, want 2", xattr_REPLACE)
|
||||
}
|
||||
}
|
||||
+66
-4
@@ -31,8 +31,6 @@ import (
|
||||
"github.com/seaweedfs/seaweedfs/weed/util/grace"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util/version"
|
||||
"github.com/seaweedfs/seaweedfs/weed/wdclient"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fs"
|
||||
)
|
||||
|
||||
type Option struct {
|
||||
@@ -136,7 +134,6 @@ type WFS struct {
|
||||
// follow https://github.com/hanwen/go-fuse/blob/master/fuse/api.go
|
||||
fuse.RawFileSystem
|
||||
mount_pb.UnimplementedSeaweedMountServer
|
||||
fs.Inode
|
||||
option *Option
|
||||
metaCache *meta_cache.MetaCache
|
||||
stats statsCache
|
||||
@@ -190,6 +187,12 @@ type WFS struct {
|
||||
// Must be waited on before unmount cleanup to prevent data loss.
|
||||
asyncFlushWg sync.WaitGroup
|
||||
|
||||
// entryChanged is notified of every applied metadata event, for a front
|
||||
// end that has to push invalidations to its own client.
|
||||
entryChangeMu sync.RWMutex
|
||||
entryChanged func(meta_cache.EntryInvalidation)
|
||||
asyncFlushClose sync.Once
|
||||
|
||||
// asyncFlushCh is a bounded work queue for background flush operations.
|
||||
// A fixed pool of worker goroutines processes items from this channel,
|
||||
// preventing resource exhaustion from unbounded goroutine creation.
|
||||
@@ -307,7 +310,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
|
||||
wfs.inodeToPath.MarkChildrenCached(path)
|
||||
}, func(path util.FullPath) bool {
|
||||
return wfs.inodeToPath.IsChildrenCached(path)
|
||||
}, wfs.invalidateOpenFileHandle, func(dirPath util.FullPath) {
|
||||
}, wfs.onEntryInvalidation, func(dirPath util.FullPath) {
|
||||
if wfs.inodeToPath.RecordDirectoryUpdate(dirPath, time.Now(), wfs.dirHotWindow, wfs.dirHotThreshold) {
|
||||
wfs.markDirectoryReadThrough(dirPath)
|
||||
}
|
||||
@@ -630,6 +633,14 @@ func (wfs *WFS) lookupEntry(fullpath util.FullPath) (*filer.Entry, entryVersion,
|
||||
}
|
||||
}
|
||||
|
||||
// About to trust the filer, so first let any async flush of a just-closed
|
||||
// handle land: it would otherwise answer with pre-close metadata, a
|
||||
// truncate's old size or a write's old chunks. The cache paths above are
|
||||
// already consistent and must not pay this wait.
|
||||
if inode, found := wfs.inodeToPath.GetInode(fullpath); found {
|
||||
wfs.waitForPendingAsyncFlush(inode)
|
||||
}
|
||||
|
||||
// Directory not cached - fetch directly from filer without caching the entire directory.
|
||||
glog.V(4).Infof("lookupEntry fetching from filer %s", fullpath)
|
||||
var entry *filer_pb.Entry
|
||||
@@ -670,6 +681,28 @@ func (wfs *WFS) lookupEntry(fullpath util.FullPath) (*filer.Entry, entryVersion,
|
||||
glog.V(4).Infof("lookupEntry found deferred entry in local cache %s", fullpath)
|
||||
return localEntry, entryVersion{tsNs: localVersionTsNs}, fuse.OK
|
||||
}
|
||||
// Creating many files at once can push the directory past
|
||||
// the hot threshold and evict it, which drops the local
|
||||
// placeholder a deferred create left behind. The handle
|
||||
// still holding the unflushed entry is authoritative for
|
||||
// it, so read it from there rather than reporting a file
|
||||
// that plainly exists as missing.
|
||||
if fh, fhFound := wfs.fhMap.FindFileHandle(inode); fhFound {
|
||||
// Async upload workers append chunks under this lock;
|
||||
// hold it for reading so FromPbEntry does not walk the
|
||||
// chunk slice mid-reallocation.
|
||||
fh.entryLock.RLock()
|
||||
pbEntry := fh.GetEntry().GetEntry()
|
||||
var localEntry *filer.Entry
|
||||
if pbEntry != nil {
|
||||
localEntry = filer.FromPbEntry(dir, pbEntry)
|
||||
}
|
||||
fh.entryLock.RUnlock()
|
||||
if localEntry != nil {
|
||||
glog.V(4).Infof("lookupEntry found deferred entry on its open handle %s", fullpath)
|
||||
return localEntry, entryVersion{}, fuse.OK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if inodeFound {
|
||||
@@ -749,6 +782,35 @@ func sameEntryContent(a, b *filer_pb.Entry) bool {
|
||||
// invalidateOpenFileHandle refreshes an open file handle from a metadata
|
||||
// subscription event. No filer lookup here: it can fail transiently, and with
|
||||
// the subscription cursor already past the event, nothing would retry.
|
||||
|
||||
// SetEntryChangeListener registers a callback for every metadata event this
|
||||
// mount applies. A front end whose client caches entries on its own side, and
|
||||
// which the mount cannot invalidate directly, uses it to push the change out.
|
||||
func (wfs *WFS) SetEntryChangeListener(fn func(meta_cache.EntryInvalidation)) {
|
||||
wfs.entryChangeMu.Lock()
|
||||
wfs.entryChanged = fn
|
||||
wfs.entryChangeMu.Unlock()
|
||||
}
|
||||
|
||||
// onEntryInvalidation runs for every applied event, whether or not the path is
|
||||
// open here, so a listener sees changes made anywhere in the cluster.
|
||||
func (wfs *WFS) onEntryInvalidation(invalidation meta_cache.EntryInvalidation) {
|
||||
wfs.entryChangeMu.RLock()
|
||||
listener := wfs.entryChanged
|
||||
wfs.entryChangeMu.RUnlock()
|
||||
if listener != nil {
|
||||
listener(invalidation)
|
||||
}
|
||||
wfs.invalidateOpenFileHandle(invalidation)
|
||||
}
|
||||
|
||||
// MountRoot is the filer path this mount is rooted at. Event paths are absolute
|
||||
// on the filer; a front end that addresses files relative to the mount needs it
|
||||
// to translate them.
|
||||
func (wfs *WFS) MountRoot() util.FullPath {
|
||||
return util.FullPath(wfs.option.FilerMountRootPath)
|
||||
}
|
||||
|
||||
func (wfs *WFS) invalidateOpenFileHandle(invalidation meta_cache.EntryInvalidation) {
|
||||
filePath, eventEntry, eventTsNs := invalidation.Path, invalidation.Entry, invalidation.TsNs
|
||||
inode, inodeFound := wfs.inodeToPath.GetInode(filePath)
|
||||
|
||||
@@ -155,7 +155,7 @@ func checkStickyBit(dirMode, dirUid, targetUid, callerUid uint32) fuse.Status {
|
||||
|
||||
// openFlagsToAccessMask converts open(2) flags to an access permission mask.
|
||||
func openFlagsToAccessMask(flags uint32) uint32 {
|
||||
switch flags & uint32(syscall.O_ACCMODE) {
|
||||
switch flags & uint32(o_ACCMODE) {
|
||||
case syscall.O_WRONLY:
|
||||
return fuse.W_OK
|
||||
case syscall.O_RDWR:
|
||||
|
||||
@@ -133,10 +133,14 @@ func (wfs *WFS) flushMetadataWithRetry(fh *FileHandle, dir, name string, fileFul
|
||||
// Called before unmount cleanup to ensure no data is lost.
|
||||
func (wfs *WFS) WaitForAsyncFlush() {
|
||||
wfs.asyncFlushWg.Wait()
|
||||
if wfs.asyncFlushCh != nil {
|
||||
close(wfs.asyncFlushCh)
|
||||
}
|
||||
if wfs.streamMutate != nil {
|
||||
wfs.streamMutate.Close()
|
||||
}
|
||||
// Shutdown reaches here from both the interrupt hook and the path that
|
||||
// resumes once serving stops, so closing has to survive a second caller.
|
||||
wfs.asyncFlushClose.Do(func() {
|
||||
if wfs.asyncFlushCh != nil {
|
||||
close(wfs.asyncFlushCh)
|
||||
}
|
||||
if wfs.streamMutate != nil {
|
||||
wfs.streamMutate.Close()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -387,6 +387,20 @@ func (wfs *WFS) setAtime(inode uint64, t time.Time) {
|
||||
}
|
||||
|
||||
// applyInMemoryAtime overlays the in-memory atime onto a fuse.Attr if present.
|
||||
// forgetInMemoryTimes drops the overlays for an inode. Both maps are keyed by
|
||||
// inode and inodes are derived from the path, so a delete and recreate can
|
||||
// hand the same number to a different file — which would then inherit the
|
||||
// previous one's access or modification time.
|
||||
func (wfs *WFS) forgetInMemoryTimes(inode uint64) {
|
||||
wfs.atimeMu.Lock()
|
||||
delete(wfs.atimeMap, inode)
|
||||
wfs.atimeMu.Unlock()
|
||||
|
||||
wfs.dirMtimeMu.Lock()
|
||||
delete(wfs.dirMtimeMap, inode)
|
||||
wfs.dirMtimeMu.Unlock()
|
||||
}
|
||||
|
||||
func (wfs *WFS) applyInMemoryAtime(out *fuse.Attr, inode uint64) {
|
||||
wfs.atimeMu.Lock()
|
||||
if t, ok := wfs.atimeMap[inode]; ok {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package mount
|
||||
|
||||
import (
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
)
|
||||
|
||||
func setBlksize(out *fuse.Attr, size uint32) {
|
||||
}
|
||||
@@ -139,14 +139,14 @@ func (wfs *WFS) FsyncDir(cancel <-chan struct{}, input *fuse.FsyncIn) (code fuse
|
||||
* '1'.
|
||||
*/
|
||||
func (wfs *WFS) ReadDir(cancel <-chan struct{}, input *fuse.ReadIn, out *fuse.DirEntryList) (code fuse.Status) {
|
||||
return wfs.doReadDirectory(input, out, false)
|
||||
return wfs.doReadDirectory(input, fuseDirEntryList{out}, false)
|
||||
}
|
||||
|
||||
func (wfs *WFS) ReadDirPlus(cancel <-chan struct{}, input *fuse.ReadIn, out *fuse.DirEntryList) (code fuse.Status) {
|
||||
return wfs.doReadDirectory(input, out, true)
|
||||
return wfs.doReadDirectory(input, fuseDirEntryList{out}, true)
|
||||
}
|
||||
|
||||
func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPlusMode bool) fuse.Status {
|
||||
func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out DirEntrySink, isPlusMode bool) fuse.Status {
|
||||
// Get the directory handle and lock it for the duration of this operation.
|
||||
// This serializes concurrent readdir calls on the same handle, fixing the
|
||||
// race condition that caused hangs with NFS-Ganesha.
|
||||
@@ -182,11 +182,11 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
|
||||
dirEntry.Off = dh.entryStreamOffset + uint64(index) + 1
|
||||
|
||||
if !isPlusMode {
|
||||
if !out.AddDirEntry(dirEntry) {
|
||||
if !out.AddEntry(dirEntry) {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
entryOut := out.AddDirLookupEntry(dirEntry)
|
||||
entryOut := out.AddEntryPlus(dirEntry)
|
||||
if entryOut == nil {
|
||||
return false
|
||||
}
|
||||
@@ -203,14 +203,14 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
|
||||
if input.Offset < directoryStreamBaseOffset {
|
||||
if !isPlusMode {
|
||||
if input.Offset == 0 {
|
||||
out.AddDirEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".", Off: 1})
|
||||
out.AddEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".", Off: 1})
|
||||
}
|
||||
out.AddDirEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "..", Off: 2})
|
||||
out.AddEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "..", Off: 2})
|
||||
} else {
|
||||
if input.Offset == 0 {
|
||||
out.AddDirLookupEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".", Off: 1})
|
||||
out.AddEntryPlus(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".", Off: 1})
|
||||
}
|
||||
out.AddDirLookupEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "..", Off: 2})
|
||||
out.AddEntryPlus(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "..", Off: 2})
|
||||
}
|
||||
input.Offset = directoryStreamBaseOffset
|
||||
}
|
||||
@@ -296,7 +296,7 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
|
||||
return fuse.OK
|
||||
}
|
||||
|
||||
func (wfs *WFS) readDirectoryDirect(input *fuse.ReadIn, out *fuse.DirEntryList, dh *DirectoryHandle, dirPath util.FullPath, processEachEntryFn func(entry *filer.Entry, index int64) bool) fuse.Status {
|
||||
func (wfs *WFS) readDirectoryDirect(input *fuse.ReadIn, out DirEntrySink, dh *DirectoryHandle, dirPath util.FullPath, processEachEntryFn func(entry *filer.Entry, index int64) bool) fuse.Status {
|
||||
var lastEntryName string
|
||||
|
||||
if input.Offset >= dh.entryStreamOffset {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package mount
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
)
|
||||
|
||||
@@ -56,7 +54,7 @@ func (wfs *WFS) SetLkw(cancel <-chan struct{}, in *fuse.LkIn) fuse.Status {
|
||||
Pid: in.Lk.Pid,
|
||||
IsFlock: in.LkFlags&fuse.FUSE_LK_FLOCK != 0,
|
||||
}
|
||||
if lk.Typ == syscall.F_UNLCK {
|
||||
if lk.Typ == f_UNLCK {
|
||||
return wfs.posixLocks.SetLk(in.NodeId, lk)
|
||||
}
|
||||
return wfs.posixLocks.SetLkw(in.NodeId, lk, cancel)
|
||||
|
||||
@@ -65,10 +65,14 @@ func (wfs *WFS) Forget(nodeid, nlookup uint64) {
|
||||
// lifecycle is driven independently by FUSE Open/Release — touching the
|
||||
// fhMap here would couple two unrelated refcounts and could tear down a
|
||||
// still-live handle if Forget ever raced ahead of Release.
|
||||
wfs.inodeToPath.Forget(nodeid, nlookup, func(dir util.FullPath) {
|
||||
// Runs after Forget releases its lock; a concurrent lookup+rebuild can
|
||||
// re-cache the directory in that window, so purge through the apply loop
|
||||
// rather than wiping the store directly.
|
||||
wfs.purgeDirectoryCache(dir)
|
||||
})
|
||||
wfs.inodeToPath.Forget(nodeid, nlookup,
|
||||
// Runs at the release, under the table's lock, so a lookup that
|
||||
// rebuilds the same inode number afterwards keeps the times it sets.
|
||||
wfs.forgetInMemoryTimes,
|
||||
func(dir util.FullPath) {
|
||||
// Runs after Forget releases its lock; a concurrent lookup+rebuild can
|
||||
// re-cache the directory in that window, so purge through the apply loop
|
||||
// rather than wiping the store directly.
|
||||
wfs.purgeDirectoryCache(dir)
|
||||
})
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"encoding/hex"
|
||||
"math/rand/v2"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
@@ -103,9 +102,9 @@ func (wfs *WFS) posixLockKeyForInode(inode uint64) (string, bool) {
|
||||
|
||||
func posixLockTypeToWire(typ uint32) uint32 {
|
||||
switch typ {
|
||||
case syscall.F_RDLCK:
|
||||
case f_RDLCK:
|
||||
return posixlock.Read
|
||||
case syscall.F_WRLCK:
|
||||
case f_WRLCK:
|
||||
return posixlock.Write
|
||||
default:
|
||||
return posixlock.Unlock
|
||||
@@ -115,11 +114,11 @@ func posixLockTypeToWire(typ uint32) uint32 {
|
||||
func posixLockTypeFromWire(typ uint32) uint32 {
|
||||
switch typ {
|
||||
case posixlock.Read:
|
||||
return syscall.F_RDLCK
|
||||
return f_RDLCK
|
||||
case posixlock.Write:
|
||||
return syscall.F_WRLCK
|
||||
return f_WRLCK
|
||||
default:
|
||||
return syscall.F_UNLCK
|
||||
return f_UNLCK
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +185,7 @@ func (wfs *WFS) routedGetLk(cancel <-chan struct{}, in *fuse.LkIn, out *fuse.LkO
|
||||
out.Lk.Start, out.Lk.End, out.Lk.Pid = c.GetStart(), c.GetEnd(), c.GetPid()
|
||||
out.Lk.Typ = posixLockTypeFromWire(c.GetType())
|
||||
} else {
|
||||
out.Lk.Typ = syscall.F_UNLCK
|
||||
out.Lk.Typ = f_UNLCK
|
||||
}
|
||||
return fuse.OK
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//go:build !windows
|
||||
|
||||
package mount
|
||||
|
||||
import (
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fs"
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
"github.com/seaweedfs/seaweedfs/weed/cluster/lock_manager"
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
@@ -160,7 +159,7 @@ renameat2()
|
||||
const (
|
||||
RenameEmptyFlag = 0
|
||||
RenameNoReplace = 1
|
||||
RenameExchange = fs.RENAME_EXCHANGE
|
||||
RenameExchange = 2
|
||||
RenameWhiteout = 3
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"syscall"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
sys "golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -123,11 +122,11 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr st
|
||||
}
|
||||
_, exists := entry.Extended[XATTR_PREFIX+attr]
|
||||
switch input.Flags {
|
||||
case sys.XATTR_CREATE:
|
||||
case xattr_CREATE:
|
||||
if exists {
|
||||
return fuse.Status(syscall.EEXIST)
|
||||
}
|
||||
case sys.XATTR_REPLACE:
|
||||
case xattr_REPLACE:
|
||||
if !exists {
|
||||
return fuse.ENODATA
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
//go:build !windows && !freebsd
|
||||
|
||||
package mount
|
||||
|
||||
import sys "golang.org/x/sys/unix"
|
||||
|
||||
const (
|
||||
xattr_CREATE = sys.XATTR_CREATE
|
||||
xattr_REPLACE = sys.XATTR_REPLACE
|
||||
)
|
||||
@@ -0,0 +1,118 @@
|
||||
// Package winfsp mounts a SeaweedFS filesystem on Windows through WinFsp.
|
||||
//
|
||||
// WinFsp speaks a path-based FUSE dialect, while weed/mount implements the
|
||||
// inode-based raw protocol the Linux kernel uses. This package translates
|
||||
// between the two so both platforms run the same filesystem code.
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
)
|
||||
|
||||
// cgofuse decodes what these operations return using MSVC/UCRT numbering,
|
||||
// which parts company with Linux above 35: ENAMETOOLONG is 38 there and 36 is
|
||||
// EDEADLK, so borrowing the Linux values silently reported the wrong error.
|
||||
// errno_windows_test.go pins each of these to cgofuse's own constant.
|
||||
const (
|
||||
ePERM = 1
|
||||
eNOENT = 2
|
||||
eINTR = 4
|
||||
eIO = 5
|
||||
eNXIO = 6
|
||||
eBADF = 9
|
||||
eAGAIN = 11
|
||||
eNOMEM = 12
|
||||
eACCES = 13
|
||||
eBUSY = 16
|
||||
eEXIST = 17
|
||||
eXDEV = 18
|
||||
eNODEV = 19
|
||||
eNOTDIR = 20
|
||||
eISDIR = 21
|
||||
eINVAL = 22
|
||||
eNFILE = 23
|
||||
eMFILE = 24
|
||||
eFBIG = 27
|
||||
eNOSPC = 28
|
||||
eSPIPE = 29
|
||||
eROFS = 30
|
||||
eMLINK = 31
|
||||
ePIPE = 32
|
||||
eRANGE = 34
|
||||
|
||||
eNAMETOOLONG = 38
|
||||
eNOSYS = 40
|
||||
eNOTEMPTY = 41
|
||||
eLOOP = 114
|
||||
eNODATA = 120
|
||||
eNOTSUP = 129
|
||||
)
|
||||
|
||||
// statusErrno is keyed by the running platform's errno values, since that is
|
||||
// what the raw filesystem returns, and yields the POSIX number for the wire.
|
||||
// Built rather than declared: platforms alias errnos differently (freebsd has
|
||||
// no ENODATA, linux makes ENOATTR the same value), so entries can collide.
|
||||
// First one wins, so the general codes keep their meaning.
|
||||
var statusErrno = buildStatusErrno()
|
||||
|
||||
func buildStatusErrno() map[fuse.Status]int {
|
||||
table := []struct {
|
||||
status fuse.Status
|
||||
errno int
|
||||
}{
|
||||
{fuse.Status(syscall.EPERM), ePERM},
|
||||
{fuse.Status(syscall.ENOENT), eNOENT},
|
||||
{fuse.Status(syscall.EINTR), eINTR},
|
||||
{fuse.Status(syscall.EIO), eIO},
|
||||
{fuse.Status(syscall.ENXIO), eNXIO},
|
||||
{fuse.Status(syscall.EBADF), eBADF},
|
||||
{fuse.Status(syscall.EAGAIN), eAGAIN},
|
||||
{fuse.Status(syscall.ENOMEM), eNOMEM},
|
||||
{fuse.Status(syscall.EACCES), eACCES},
|
||||
{fuse.Status(syscall.EBUSY), eBUSY},
|
||||
{fuse.Status(syscall.EEXIST), eEXIST},
|
||||
{fuse.Status(syscall.EXDEV), eXDEV},
|
||||
{fuse.Status(syscall.ENODEV), eNODEV},
|
||||
{fuse.Status(syscall.ENOTDIR), eNOTDIR},
|
||||
{fuse.Status(syscall.EISDIR), eISDIR},
|
||||
{fuse.Status(syscall.EINVAL), eINVAL},
|
||||
{fuse.Status(syscall.ENFILE), eNFILE},
|
||||
{fuse.Status(syscall.EMFILE), eMFILE},
|
||||
{fuse.Status(syscall.EFBIG), eFBIG},
|
||||
{fuse.Status(syscall.ENOSPC), eNOSPC},
|
||||
{fuse.Status(syscall.ESPIPE), eSPIPE},
|
||||
{fuse.Status(syscall.EROFS), eROFS},
|
||||
{fuse.Status(syscall.EMLINK), eMLINK},
|
||||
{fuse.Status(syscall.EPIPE), ePIPE},
|
||||
{fuse.Status(syscall.ERANGE), eRANGE},
|
||||
{fuse.Status(syscall.ENAMETOOLONG), eNAMETOOLONG},
|
||||
{fuse.Status(syscall.ENOSYS), eNOSYS},
|
||||
{fuse.Status(syscall.ENOTEMPTY), eNOTEMPTY},
|
||||
{fuse.Status(syscall.ELOOP), eLOOP},
|
||||
{fuse.ENOTSUP, eNOTSUP},
|
||||
{fuse.ENODATA, eNODATA},
|
||||
{fuse.ENOATTR, eNODATA},
|
||||
}
|
||||
m := make(map[fuse.Status]int, len(table))
|
||||
for _, entry := range table {
|
||||
if _, exists := m[entry.status]; !exists {
|
||||
m[entry.status] = entry.errno
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
// toErrno converts a raw filesystem status into the negative errno WinFsp
|
||||
// wants. Unrecognised failures become -EIO rather than passing through a
|
||||
// number that means something else on the other side.
|
||||
func toErrno(status fuse.Status) int {
|
||||
if status == fuse.OK {
|
||||
return 0
|
||||
}
|
||||
if n, ok := statusErrno[status]; ok {
|
||||
return -n
|
||||
}
|
||||
return -eIO
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
)
|
||||
|
||||
// The numbers have to match what cgofuse decodes on the far side, regardless
|
||||
// of how the host platform spells its own errno constants. That numbering is
|
||||
// MSVC's, which parts company with Linux above 35.
|
||||
func TestToErrnoUsesCgofuseNumbering(t *testing.T) {
|
||||
cases := []struct {
|
||||
status fuse.Status
|
||||
want int
|
||||
}{
|
||||
{fuse.OK, 0},
|
||||
{fuse.ENOENT, -2},
|
||||
{fuse.EIO, -5},
|
||||
{fuse.EACCES, -13},
|
||||
{fuse.EINVAL, -22},
|
||||
{fuse.ENOSYS, -40},
|
||||
{fuse.Status(syscall.EEXIST), -17},
|
||||
{fuse.Status(syscall.ENOSPC), -28},
|
||||
{fuse.Status(syscall.ENOTEMPTY), -41},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if got := toErrno(c.status); got != c.want {
|
||||
t.Errorf("toErrno(%v) = %d, want %d", c.status, got, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// An unmapped failure must not pass its raw number through: on Windows those
|
||||
// are APPLICATION_ERROR offsets that mean something else entirely.
|
||||
func TestToErrnoUnknownBecomesEIO(t *testing.T) {
|
||||
if got := toErrno(fuse.Status(1 << 20)); got != -eIO {
|
||||
t.Errorf("toErrno(unknown) = %d, want %d", got, -eIO)
|
||||
}
|
||||
}
|
||||
|
||||
func TestToErrnoNeverReturnsPositive(t *testing.T) {
|
||||
for _, status := range []fuse.Status{fuse.ENOENT, fuse.EPERM, fuse.EBUSY, fuse.Status(4242)} {
|
||||
if got := toErrno(status); got > 0 {
|
||||
t.Errorf("toErrno(%v) = %d, want <= 0", status, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
cgofuse "github.com/winfsp/cgofuse/fuse"
|
||||
)
|
||||
|
||||
// The errno values are spelled out so the table stays portable and testable on
|
||||
// any runner. This pins them to what cgofuse actually decodes, so a divergence
|
||||
// is a failing test rather than an operation reporting an unrelated error.
|
||||
func TestErrnoValuesMatchCgofuse(t *testing.T) {
|
||||
for _, c := range []struct {
|
||||
name string
|
||||
ours int
|
||||
want int
|
||||
}{
|
||||
{"EPERM", ePERM, cgofuse.EPERM},
|
||||
{"ENOENT", eNOENT, cgofuse.ENOENT},
|
||||
{"EINTR", eINTR, cgofuse.EINTR},
|
||||
{"EIO", eIO, cgofuse.EIO},
|
||||
{"ENXIO", eNXIO, cgofuse.ENXIO},
|
||||
{"EBADF", eBADF, cgofuse.EBADF},
|
||||
{"EAGAIN", eAGAIN, cgofuse.EAGAIN},
|
||||
{"ENOMEM", eNOMEM, cgofuse.ENOMEM},
|
||||
{"EACCES", eACCES, cgofuse.EACCES},
|
||||
{"EBUSY", eBUSY, cgofuse.EBUSY},
|
||||
{"EEXIST", eEXIST, cgofuse.EEXIST},
|
||||
{"EXDEV", eXDEV, cgofuse.EXDEV},
|
||||
{"ENODEV", eNODEV, cgofuse.ENODEV},
|
||||
{"ENOTDIR", eNOTDIR, cgofuse.ENOTDIR},
|
||||
{"EISDIR", eISDIR, cgofuse.EISDIR},
|
||||
{"EINVAL", eINVAL, cgofuse.EINVAL},
|
||||
{"ENFILE", eNFILE, cgofuse.ENFILE},
|
||||
{"EMFILE", eMFILE, cgofuse.EMFILE},
|
||||
{"EFBIG", eFBIG, cgofuse.EFBIG},
|
||||
{"ENOSPC", eNOSPC, cgofuse.ENOSPC},
|
||||
{"ESPIPE", eSPIPE, cgofuse.ESPIPE},
|
||||
{"EROFS", eROFS, cgofuse.EROFS},
|
||||
{"EMLINK", eMLINK, cgofuse.EMLINK},
|
||||
{"EPIPE", ePIPE, cgofuse.EPIPE},
|
||||
{"ERANGE", eRANGE, cgofuse.ERANGE},
|
||||
{"ENAMETOOLONG", eNAMETOOLONG, cgofuse.ENAMETOOLONG},
|
||||
{"ENOSYS", eNOSYS, cgofuse.ENOSYS},
|
||||
{"ENOTEMPTY", eNOTEMPTY, cgofuse.ENOTEMPTY},
|
||||
{"ELOOP", eLOOP, cgofuse.ELOOP},
|
||||
{"ENODATA", eNODATA, cgofuse.ENODATA},
|
||||
{"ENOTSUP", eNOTSUP, cgofuse.ENOTSUP},
|
||||
} {
|
||||
if c.ours != c.want {
|
||||
t.Errorf("%s = %d, cgofuse uses %d", c.name, c.ours, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// translateOpenFlags relies on cgofuse using MSVC's numbering while the raw
|
||||
// filesystem reads Go's. Pin that, because a swap between O_EXCL and O_TRUNC
|
||||
// would turn "fail if it exists" into "truncate it".
|
||||
func TestOpenFlagTranslation(t *testing.T) {
|
||||
for _, c := range []struct {
|
||||
name string
|
||||
in int
|
||||
want uint32
|
||||
}{
|
||||
{"O_EXCL", cgofuse.O_EXCL, uint32(syscall.O_EXCL)},
|
||||
{"O_TRUNC", cgofuse.O_TRUNC, uint32(syscall.O_TRUNC)},
|
||||
{"O_CREAT", cgofuse.O_CREAT, uint32(syscall.O_CREAT)},
|
||||
{"O_APPEND", cgofuse.O_APPEND, uint32(syscall.O_APPEND)},
|
||||
} {
|
||||
if got := translateOpenFlags(c.in); got != c.want {
|
||||
t.Errorf("translateOpenFlags(%s=%#x) = %#x, want %#x", c.name, c.in, got, c.want)
|
||||
}
|
||||
}
|
||||
if got := translateOpenFlags(cgofuse.O_RDWR); got != uint32(syscall.O_RDWR) {
|
||||
t.Errorf("access mode not preserved: %#x", got)
|
||||
}
|
||||
}
|
||||
|
||||
// Setxattr passes cgofuse's flags straight to the raw filesystem, which is
|
||||
// only correct while the two number them identically. The other side is
|
||||
// pinned by TestXattrFlagValues in weed/mount, so editing either alone fails.
|
||||
func TestXattrFlagValues(t *testing.T) {
|
||||
if cgofuse.XATTR_CREATE != 1 || cgofuse.XATTR_REPLACE != 2 {
|
||||
t.Fatalf("cgofuse xattr flags moved: create=%d replace=%d", cgofuse.XATTR_CREATE, cgofuse.XATTR_REPLACE)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,754 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
cgofuse "github.com/winfsp/cgofuse/fuse"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount"
|
||||
)
|
||||
|
||||
const (
|
||||
rootInode = 1
|
||||
|
||||
// WinFsp passes this when an operation carries no open handle.
|
||||
noHandle = ^uint64(0)
|
||||
|
||||
// utimeOmit is the nanosecond marker asking for a timestamp to be left as
|
||||
// it is; cgofuse hands it through rather than resolving it.
|
||||
utimeOmit = (1 << 30) - 2
|
||||
|
||||
// windowsEpochCutoff is 1601-01-02 in unix seconds. Anything at or below
|
||||
// it is Windows' own epoch leaking through rather than a real time.
|
||||
windowsEpochCutoff = -11644387200
|
||||
|
||||
// How many entries to pull from one readdir round before handing them to
|
||||
// WinFsp. Bounded so a directory with millions of children does not
|
||||
// materialise in one slice.
|
||||
readdirBatch = 4096
|
||||
)
|
||||
|
||||
// never is a nil channel: receiving blocks forever, which is what the raw
|
||||
// operations expect from a caller that cannot cancel.
|
||||
var never chan struct{}
|
||||
|
||||
// WinFS presents a mount.WFS through the path-based interface WinFsp speaks.
|
||||
type WinFS struct {
|
||||
cgofuse.FileSystemBase
|
||||
|
||||
wfs *mount.WFS
|
||||
uid uint32
|
||||
gid uint32
|
||||
readOnly bool
|
||||
|
||||
// An open handle holds the lookup reference for its inode until Release,
|
||||
// the way the kernel keeps one for an open file. WinFsp hands back only
|
||||
// the handle, and the raw filesystem reuses one handle for repeated opens
|
||||
// of the same inode, so the references are counted.
|
||||
mu sync.Mutex
|
||||
fileInodes map[uint64]*handleRef
|
||||
dirInodes map[uint64]*handleRef
|
||||
}
|
||||
|
||||
func NewWinFS(wfs *mount.WFS, uid, gid uint32, readOnly bool) *WinFS {
|
||||
return &WinFS{
|
||||
wfs: wfs,
|
||||
uid: uid,
|
||||
gid: gid,
|
||||
readOnly: readOnly,
|
||||
fileInodes: make(map[uint64]*handleRef),
|
||||
dirInodes: make(map[uint64]*handleRef),
|
||||
}
|
||||
}
|
||||
|
||||
// handleRef is the lookup references an open handle is holding, one per open
|
||||
// that has not yet been released.
|
||||
type handleRef struct {
|
||||
inode uint64
|
||||
count int
|
||||
}
|
||||
|
||||
// retain parks one reference under a handle.
|
||||
func (w *WinFS) retain(table map[uint64]*handleRef, handle, inode uint64) {
|
||||
if handle == noHandle {
|
||||
return
|
||||
}
|
||||
var stranded uint64
|
||||
w.mu.Lock()
|
||||
switch existing, found := table[handle]; {
|
||||
case found && existing.inode == inode:
|
||||
existing.count++
|
||||
case found:
|
||||
// The handle was reissued for a different inode; its old reference
|
||||
// would otherwise never be returned.
|
||||
stranded = existing.inode
|
||||
table[handle] = &handleRef{inode: inode, count: 1}
|
||||
default:
|
||||
table[handle] = &handleRef{inode: inode, count: 1}
|
||||
}
|
||||
w.mu.Unlock()
|
||||
w.forget(stranded)
|
||||
}
|
||||
|
||||
// releaseRetained hands back one reference, reporting the inode only once the
|
||||
// last open of that handle is gone, so a repeated release cannot forget twice.
|
||||
func (w *WinFS) releaseRetained(table map[uint64]*handleRef, handle uint64) uint64 {
|
||||
w.mu.Lock()
|
||||
defer w.mu.Unlock()
|
||||
existing, found := table[handle]
|
||||
if !found {
|
||||
return 0
|
||||
}
|
||||
existing.count--
|
||||
if existing.count > 0 {
|
||||
return 0
|
||||
}
|
||||
delete(table, handle)
|
||||
return existing.inode
|
||||
}
|
||||
|
||||
// caller identifies who the raw filesystem should record as the owner of
|
||||
// anything it creates. Windows has no uid to pass through, so entries carry
|
||||
// the identity the mount was started with rather than root.
|
||||
// denied reports whether a modification should be refused outright, which is
|
||||
// how a read-only mount is enforced: WinFsp discards its own "ro" option.
|
||||
func (w *WinFS) denied() bool { return w.readOnly }
|
||||
|
||||
// inodeForHandle reports the inode an open handle is holding, or 0. WinFsp
|
||||
// keeps the path it opened with and never updates it across a rename, so a
|
||||
// handle is the more reliable of the two.
|
||||
func (w *WinFS) inodeForHandle(table map[uint64]*handleRef, handle uint64) uint64 {
|
||||
if handle == noHandle {
|
||||
return 0
|
||||
}
|
||||
w.mu.Lock()
|
||||
defer w.mu.Unlock()
|
||||
if existing, found := table[handle]; found {
|
||||
return existing.inode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// ptr is for the operations that take the header by pointer.
|
||||
func ptr(h fuse.InHeader) *fuse.InHeader { return &h }
|
||||
|
||||
func (w *WinFS) caller(inode uint64) fuse.InHeader {
|
||||
return fuse.InHeader{
|
||||
NodeId: inode,
|
||||
Caller: fuse.Caller{Owner: fuse.Owner{Uid: w.uid, Gid: w.gid}},
|
||||
}
|
||||
}
|
||||
|
||||
// lookupRef collects the references a resolution took. Every operation that
|
||||
// hands back an EntryOut grants the caller one, which the Linux kernel returns
|
||||
// with FORGET. WinFsp has no FORGET, so anything the adapter looks up it has
|
||||
// to release itself or the mount's inode table grows for the life of the
|
||||
// process.
|
||||
type lookupRef struct {
|
||||
w *WinFS
|
||||
inodes []uint64
|
||||
}
|
||||
|
||||
// release returns every reference still held.
|
||||
func (r *lookupRef) release() {
|
||||
if r == nil {
|
||||
return
|
||||
}
|
||||
for _, inode := range r.inodes {
|
||||
r.w.forget(inode)
|
||||
}
|
||||
r.inodes = nil
|
||||
}
|
||||
|
||||
// keepLast hands the reference on the final component to the caller, which
|
||||
// becomes responsible for releasing it. An open handle takes it this way and
|
||||
// gives it back on Release.
|
||||
func (r *lookupRef) keepLast() {
|
||||
if r != nil && len(r.inodes) > 0 {
|
||||
r.inodes = r.inodes[:len(r.inodes)-1]
|
||||
}
|
||||
}
|
||||
|
||||
// forget returns one reference. The root is never looked up, so it never holds
|
||||
// one to give back.
|
||||
func (w *WinFS) forget(inode uint64) {
|
||||
if inode == rootInode || inode == 0 {
|
||||
return
|
||||
}
|
||||
w.wfs.Forget(inode, 1)
|
||||
}
|
||||
|
||||
// walk resolves a path one component at a time. Lookup does more than find an
|
||||
// inode: it refreshes what the mount knows about the entry, so the result of a
|
||||
// preceding truncate or write is visible to the caller.
|
||||
func (w *WinFS) walk(parts []string) (uint64, *lookupRef, fuse.Status) {
|
||||
ref := &lookupRef{w: w}
|
||||
inode := uint64(rootInode)
|
||||
for _, name := range parts {
|
||||
var out fuse.EntryOut
|
||||
if status := w.wfs.Lookup(never, ptr(w.caller(inode)), name, &out); status != fuse.OK {
|
||||
ref.release()
|
||||
return 0, nil, status
|
||||
}
|
||||
inode = out.NodeId
|
||||
ref.inodes = append(ref.inodes, inode)
|
||||
}
|
||||
return inode, ref, fuse.OK
|
||||
}
|
||||
|
||||
// resolve walks a WinFsp path down to an inode. The caller must release the
|
||||
// returned reference.
|
||||
func (w *WinFS) resolve(path string) (uint64, *lookupRef, fuse.Status) {
|
||||
return w.walk(splitPath(path))
|
||||
}
|
||||
|
||||
// resolveParent resolves everything but the last component, which the create
|
||||
// and delete operations need separately. The caller must release the reference.
|
||||
func (w *WinFS) resolveParent(path string) (uint64, string, *lookupRef, fuse.Status) {
|
||||
parentParts, name, ok := splitParent(path)
|
||||
if !ok {
|
||||
return 0, "", nil, fuse.EINVAL
|
||||
}
|
||||
parent, ref, status := w.walk(parentParts)
|
||||
if status != fuse.OK {
|
||||
return 0, "", nil, status
|
||||
}
|
||||
return parent, name, ref, fuse.OK
|
||||
}
|
||||
|
||||
func (w *WinFS) attrToStat(attr *fuse.Attr, stat *cgofuse.Stat_t) {
|
||||
stat.Ino = attr.Ino
|
||||
stat.Mode = attr.Mode
|
||||
stat.Nlink = attr.Nlink
|
||||
stat.Size = int64(attr.Size)
|
||||
stat.Blocks = int64(attr.Blocks)
|
||||
stat.Blksize = int64(attr.Blksize)
|
||||
stat.Uid = w.uid
|
||||
stat.Gid = w.gid
|
||||
stat.Atim = cgofuse.Timespec{Sec: int64(attr.Atime), Nsec: int64(attr.Atimensec)}
|
||||
stat.Mtim = cgofuse.Timespec{Sec: int64(attr.Mtime), Nsec: int64(attr.Mtimensec)}
|
||||
stat.Ctim = cgofuse.Timespec{Sec: int64(attr.Ctime), Nsec: int64(attr.Ctimensec)}
|
||||
// The filer records a creation time, but the raw protocol's Attr carries no
|
||||
// field for it outside darwin, so ctime stands in until there is a way to
|
||||
// read it through.
|
||||
stat.Birthtim = stat.Ctim
|
||||
// Windows expects a regular file to be marked archived; with no flags at
|
||||
// all it synthesises NORMAL, which is a different thing and what
|
||||
// create_fileattr_test checks.
|
||||
if attr.Mode&cgofuse.S_IFMT == cgofuse.S_IFREG {
|
||||
stat.Flags |= cgofuse.UF_ARCHIVE
|
||||
}
|
||||
}
|
||||
|
||||
// translateOpenFlags converts cgofuse's open flags, which follow MSVC's
|
||||
// numbering, into the values the raw filesystem tests against. Only the access
|
||||
// mode and O_TRUNC happen to agree; O_EXCL would otherwise read as O_APPEND.
|
||||
func translateOpenFlags(flags int) uint32 {
|
||||
out := uint32(flags & cgofuse.O_ACCMODE)
|
||||
for _, pair := range []struct {
|
||||
from int
|
||||
to int
|
||||
}{
|
||||
{cgofuse.O_APPEND, syscall.O_APPEND},
|
||||
{cgofuse.O_CREAT, syscall.O_CREAT},
|
||||
{cgofuse.O_TRUNC, syscall.O_TRUNC},
|
||||
{cgofuse.O_EXCL, syscall.O_EXCL},
|
||||
} {
|
||||
if flags&pair.from != 0 {
|
||||
out |= uint32(pair.to)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// logResolveFailure keeps a missing file quiet. Windows probes for entries
|
||||
// that do not exist as a matter of course, so ENOENT is an answer rather than
|
||||
// a fault; anything else is worth a line.
|
||||
func logResolveFailure(op, path string, status fuse.Status) {
|
||||
if status == fuse.ENOENT {
|
||||
glog.V(4).Infof("%s %s: no such entry", op, path)
|
||||
return
|
||||
}
|
||||
glog.Errorf("%s %s: resolving: %v", op, path, status)
|
||||
}
|
||||
|
||||
func (w *WinFS) Statfs(path string, stat *cgofuse.Statfs_t) int {
|
||||
var out fuse.StatfsOut
|
||||
if status := w.wfs.StatFs(never, ptr(w.caller(rootInode)), &out); status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
stat.Bsize = uint64(out.Bsize)
|
||||
stat.Frsize = uint64(out.Frsize)
|
||||
stat.Blocks = out.Blocks
|
||||
stat.Bfree = out.Bfree
|
||||
stat.Bavail = out.Bavail
|
||||
stat.Files = out.Files
|
||||
stat.Ffree = out.Ffree
|
||||
stat.Favail = out.Ffree
|
||||
stat.Namemax = uint64(out.NameLen)
|
||||
return 0
|
||||
}
|
||||
|
||||
func (w *WinFS) Getattr(path string, stat *cgofuse.Stat_t, fh uint64) int {
|
||||
inode := w.inodeForHandle(w.fileInodes, fh)
|
||||
if inode == 0 {
|
||||
var ref *lookupRef
|
||||
var status fuse.Status
|
||||
inode, ref, status = w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
logResolveFailure("getattr", path, status)
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
}
|
||||
in := &fuse.GetAttrIn{InHeader: w.caller(inode)}
|
||||
if fh != noHandle {
|
||||
in.Fh_ = fh
|
||||
in.Flags_ = fuse.FUSE_GETATTR_FH
|
||||
}
|
||||
var out fuse.AttrOut
|
||||
if status := w.wfs.GetAttr(never, in, &out); status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
w.attrToStat(&out.Attr, stat)
|
||||
return 0
|
||||
}
|
||||
|
||||
func (w *WinFS) Mkdir(path string, mode uint32) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
parent, name, ref, status := w.resolveParent(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
in := &fuse.MkdirIn{InHeader: w.caller(parent), Mode: mode}
|
||||
var out fuse.EntryOut
|
||||
status = w.wfs.Mkdir(never, in, name, &out)
|
||||
if status == fuse.OK {
|
||||
// Mkdir hands back an EntryOut, and nothing on this side will forget it.
|
||||
w.forget(out.NodeId)
|
||||
}
|
||||
return toErrno(status)
|
||||
}
|
||||
|
||||
func (w *WinFS) Rmdir(path string) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
parent, name, ref, status := w.resolveParent(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
return toErrno(w.wfs.Rmdir(never, ptr(w.caller(parent)), name))
|
||||
}
|
||||
|
||||
func (w *WinFS) Unlink(path string) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
parent, name, ref, status := w.resolveParent(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
return toErrno(w.wfs.Unlink(never, ptr(w.caller(parent)), name))
|
||||
}
|
||||
|
||||
func (w *WinFS) Rename(oldpath string, newpath string) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
oldParent, oldName, oldRef, status := w.resolveParent(oldpath)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer oldRef.release()
|
||||
newParent, newName, newRef, status := w.resolveParent(newpath)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer newRef.release()
|
||||
in := &fuse.RenameIn{InHeader: w.caller(oldParent), Newdir: newParent}
|
||||
return toErrno(w.wfs.Rename(never, in, oldName, newName))
|
||||
}
|
||||
|
||||
func (w *WinFS) Create(path string, flags int, mode uint32) (int, uint64) {
|
||||
if w.denied() {
|
||||
return -eROFS, noHandle
|
||||
}
|
||||
parent, name, ref, status := w.resolveParent(path)
|
||||
if status != fuse.OK {
|
||||
glog.Errorf("create %s: resolving the parent directory: %v", path, status)
|
||||
return toErrno(status), noHandle
|
||||
}
|
||||
defer ref.release()
|
||||
in := &fuse.CreateIn{InHeader: w.caller(parent), Flags: translateOpenFlags(flags), Mode: mode}
|
||||
var out fuse.CreateOut
|
||||
if status := w.wfs.Create(never, in, name, &out); status != fuse.OK {
|
||||
glog.Errorf("create %s in inode %d: %v", name, parent, status)
|
||||
return toErrno(status), noHandle
|
||||
}
|
||||
// Create grants a reference on the new inode; hold it for as long as the
|
||||
// handle lives and give it back in Release.
|
||||
w.retain(w.fileInodes, out.Fh, out.NodeId)
|
||||
return 0, out.Fh
|
||||
}
|
||||
|
||||
func (w *WinFS) Open(path string, flags int) (int, uint64) {
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
logResolveFailure("open", path, status)
|
||||
return toErrno(status), noHandle
|
||||
}
|
||||
defer ref.release()
|
||||
in := &fuse.OpenIn{InHeader: w.caller(inode), Flags: translateOpenFlags(flags)}
|
||||
var out fuse.OpenOut
|
||||
if status := w.wfs.Open(never, in, &out); status != fuse.OK {
|
||||
glog.Errorf("open %s inode %d: %v", path, inode, status)
|
||||
return toErrno(status), noHandle
|
||||
}
|
||||
ref.keepLast()
|
||||
w.retain(w.fileInodes, out.Fh, inode)
|
||||
return 0, out.Fh
|
||||
}
|
||||
|
||||
func (w *WinFS) Read(path string, buff []byte, ofst int64, fh uint64) int {
|
||||
if fh == noHandle {
|
||||
return -eBADF
|
||||
}
|
||||
in := &fuse.ReadIn{
|
||||
Fh: fh,
|
||||
Offset: uint64(ofst),
|
||||
Size: uint32(len(buff)),
|
||||
}
|
||||
result, status := w.wfs.Read(never, in, buff)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
data, status := result.Bytes(buff)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
if len(data) > 0 && &data[0] != &buff[0] {
|
||||
copy(buff, data)
|
||||
}
|
||||
return len(data)
|
||||
}
|
||||
|
||||
func (w *WinFS) Write(path string, buff []byte, ofst int64, fh uint64) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
if fh == noHandle {
|
||||
return -eBADF
|
||||
}
|
||||
in := &fuse.WriteIn{
|
||||
Fh: fh,
|
||||
Offset: uint64(ofst),
|
||||
Size: uint32(len(buff)),
|
||||
}
|
||||
written, status := w.wfs.Write(never, in, buff)
|
||||
if status != fuse.OK {
|
||||
if status == fuse.ENOENT {
|
||||
glog.Errorf("write %s: handle %d is not open", path, fh)
|
||||
}
|
||||
return toErrno(status)
|
||||
}
|
||||
return int(written)
|
||||
}
|
||||
|
||||
func (w *WinFS) Truncate(path string, size int64, fh uint64) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
inode := w.inodeForHandle(w.fileInodes, fh)
|
||||
if inode == 0 {
|
||||
var ref *lookupRef
|
||||
var status fuse.Status
|
||||
inode, ref, status = w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
}
|
||||
in := &fuse.SetAttrIn{}
|
||||
in.NodeId = inode
|
||||
in.Valid = fuse.FATTR_SIZE
|
||||
in.Size = uint64(size)
|
||||
if fh != noHandle {
|
||||
in.Valid |= fuse.FATTR_FH
|
||||
in.Fh = fh
|
||||
}
|
||||
var out fuse.AttrOut
|
||||
return toErrno(w.wfs.SetAttr(never, in, &out))
|
||||
}
|
||||
|
||||
func (w *WinFS) Chmod(path string, mode uint32) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
in := &fuse.SetAttrIn{}
|
||||
in.NodeId = inode
|
||||
in.Valid = fuse.FATTR_MODE
|
||||
in.Mode = mode
|
||||
var out fuse.AttrOut
|
||||
return toErrno(w.wfs.SetAttr(never, in, &out))
|
||||
}
|
||||
|
||||
func (w *WinFS) Utimens(path string, tmsp []cgofuse.Timespec) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
in := &fuse.SetAttrIn{}
|
||||
in.NodeId = inode
|
||||
if len(tmsp) < 2 {
|
||||
in.Valid = fuse.FATTR_ATIME_NOW | fuse.FATTR_MTIME_NOW
|
||||
} else {
|
||||
// Windows sends times around its own 1601 epoch, which arrive here as
|
||||
// a large negative second count and would be stored as a year-1601
|
||||
// timestamp that every other client then reads. Leave those alone.
|
||||
if applyTimespec(tmsp[0]) {
|
||||
in.Valid |= fuse.FATTR_ATIME
|
||||
in.Atime, in.Atimensec = uint64(tmsp[0].Sec), uint32(tmsp[0].Nsec)
|
||||
}
|
||||
if applyTimespec(tmsp[1]) {
|
||||
in.Valid |= fuse.FATTR_MTIME
|
||||
in.Mtime, in.Mtimensec = uint64(tmsp[1].Sec), uint32(tmsp[1].Nsec)
|
||||
}
|
||||
if in.Valid == 0 {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
var out fuse.AttrOut
|
||||
return toErrno(w.wfs.SetAttr(never, in, &out))
|
||||
}
|
||||
|
||||
// applyTimespec reports whether a timestamp should be written. UTIME_OMIT asks
|
||||
// for the existing value to be kept, and a time at or below Windows' own 1601
|
||||
// epoch arrives as a large negative second count. Exactly zero is what Windows
|
||||
// sends for a field it is not setting; storing it put 1970 in the atime
|
||||
// overlay, which then read back as the file's access time. A date genuinely
|
||||
// before 1970 is still allowed through — only the epoch itself is the
|
||||
// sentinel.
|
||||
func applyTimespec(ts cgofuse.Timespec) bool {
|
||||
if ts.Nsec == utimeOmit {
|
||||
return false
|
||||
}
|
||||
if ts.Sec == 0 && ts.Nsec == 0 {
|
||||
return false
|
||||
}
|
||||
return ts.Sec > windowsEpochCutoff
|
||||
}
|
||||
|
||||
func (w *WinFS) Flush(path string, fh uint64) int {
|
||||
if fh == noHandle {
|
||||
return 0
|
||||
}
|
||||
return toErrno(w.wfs.Flush(never, &fuse.FlushIn{InHeader: w.caller(0), Fh: fh}))
|
||||
}
|
||||
|
||||
func (w *WinFS) Fsync(path string, datasync bool, fh uint64) int {
|
||||
if fh == noHandle {
|
||||
return 0
|
||||
}
|
||||
return toErrno(w.wfs.Fsync(never, &fuse.FsyncIn{Fh: fh}))
|
||||
}
|
||||
|
||||
func (w *WinFS) Release(path string, fh uint64) int {
|
||||
if fh == noHandle {
|
||||
return 0
|
||||
}
|
||||
w.wfs.Release(never, &fuse.ReleaseIn{Fh: fh})
|
||||
w.forget(w.releaseRetained(w.fileInodes, fh))
|
||||
return 0
|
||||
}
|
||||
|
||||
func (w *WinFS) Opendir(path string) (int, uint64) {
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status), noHandle
|
||||
}
|
||||
defer ref.release()
|
||||
var out fuse.OpenOut
|
||||
if status := w.wfs.OpenDir(never, &fuse.OpenIn{InHeader: w.caller(inode)}, &out); status != fuse.OK {
|
||||
return toErrno(status), noHandle
|
||||
}
|
||||
ref.keepLast()
|
||||
w.retain(w.dirInodes, out.Fh, inode)
|
||||
return 0, out.Fh
|
||||
}
|
||||
|
||||
func (w *WinFS) Releasedir(path string, fh uint64) int {
|
||||
if fh == noHandle {
|
||||
return 0
|
||||
}
|
||||
w.wfs.ReleaseDir(&fuse.ReleaseIn{Fh: fh})
|
||||
w.forget(w.releaseRetained(w.dirInodes, fh))
|
||||
return 0
|
||||
}
|
||||
|
||||
// readdirSink collects one readdir round. The raw operation fills the returned
|
||||
// EntryOut after AddEntryPlus returns, so nothing can be converted until the
|
||||
// round is over.
|
||||
type readdirSink struct {
|
||||
names []string
|
||||
offsets []uint64
|
||||
inodes []uint64
|
||||
modes []uint32
|
||||
attrs []*fuse.EntryOut
|
||||
limit int
|
||||
|
||||
// lastOffset advances over dropped entries too, so a batch that is all
|
||||
// dot entries still moves the enumeration along.
|
||||
lastOffset uint64
|
||||
seen int
|
||||
}
|
||||
|
||||
// WinFsp strips "." and ".." for the root directory itself and expects every
|
||||
// other directory to report them, the way a real NTFS enumeration does.
|
||||
func (s *readdirSink) AddEntry(entry fuse.DirEntry) bool {
|
||||
if len(s.names) >= s.limit {
|
||||
return false
|
||||
}
|
||||
s.seen++
|
||||
s.lastOffset = entry.Off
|
||||
s.names = append(s.names, entry.Name)
|
||||
s.offsets = append(s.offsets, entry.Off)
|
||||
s.inodes = append(s.inodes, entry.Ino)
|
||||
s.modes = append(s.modes, entry.Mode)
|
||||
s.attrs = append(s.attrs, nil)
|
||||
return true
|
||||
}
|
||||
|
||||
func (s *readdirSink) AddEntryPlus(entry fuse.DirEntry) *fuse.EntryOut {
|
||||
if len(s.names) >= s.limit {
|
||||
return nil
|
||||
}
|
||||
s.seen++
|
||||
s.lastOffset = entry.Off
|
||||
out := &fuse.EntryOut{}
|
||||
s.names = append(s.names, entry.Name)
|
||||
s.offsets = append(s.offsets, entry.Off)
|
||||
s.inodes = append(s.inodes, entry.Ino)
|
||||
s.modes = append(s.modes, entry.Mode)
|
||||
s.attrs = append(s.attrs, out)
|
||||
return out
|
||||
}
|
||||
|
||||
func (w *WinFS) Readdir(path string, fill func(name string, stat *cgofuse.Stat_t, ofst int64) bool, ofst int64, fh uint64) int {
|
||||
inode := w.inodeForHandle(w.dirInodes, fh)
|
||||
if inode == 0 {
|
||||
var ref *lookupRef
|
||||
var status fuse.Status
|
||||
inode, ref, status = w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
}
|
||||
offset := uint64(ofst)
|
||||
for {
|
||||
sink := &readdirSink{limit: readdirBatch}
|
||||
in := &fuse.ReadIn{
|
||||
InHeader: w.caller(inode),
|
||||
Fh: fh,
|
||||
Offset: offset,
|
||||
Size: 1 << 20,
|
||||
}
|
||||
if status := w.wfs.ReadDirectoryInto(in, sink, true); status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
if sink.seen == 0 {
|
||||
return 0
|
||||
}
|
||||
filled := true
|
||||
for i, name := range sink.names {
|
||||
var stat cgofuse.Stat_t
|
||||
var statp *cgofuse.Stat_t
|
||||
if attr := sink.attrs[i]; attr != nil && attr.Attr.Mode != 0 {
|
||||
w.attrToStat(&attr.Attr, &stat)
|
||||
statp = &stat
|
||||
} else if sink.modes[i] != 0 {
|
||||
// "." and ".." are reported without attributes: the readdir
|
||||
// only fills a block for real children. Windows still needs
|
||||
// their type, and enumerating a directory whose first entry is
|
||||
// not marked as one fails outright.
|
||||
stat.Mode = sink.modes[i]
|
||||
stat.Ino = sink.inodes[i]
|
||||
stat.Nlink = 1
|
||||
stat.Uid, stat.Gid = w.uid, w.gid
|
||||
statp = &stat
|
||||
}
|
||||
if filled && !fill(name, statp, int64(sink.offsets[i])) {
|
||||
filled = false
|
||||
}
|
||||
}
|
||||
// A readdirplus entry carries a reference of its own. Give every one
|
||||
// of them back, including any the fill above stopped short of, or a
|
||||
// single walk of a wide directory strands one reference per child.
|
||||
for _, child := range sink.inodes {
|
||||
w.forget(child)
|
||||
}
|
||||
if !filled {
|
||||
return 0
|
||||
}
|
||||
if sink.lastOffset <= offset {
|
||||
return 0
|
||||
}
|
||||
offset = sink.lastOffset
|
||||
}
|
||||
}
|
||||
|
||||
func (w *WinFS) Readlink(path string) (int, string) {
|
||||
// WinFsp probes the root to decide whether the volume has symlinks, and
|
||||
// turns them on unless this fails. Leaving them on costs a getattr per
|
||||
// path component on every open, for a feature Symlink already refuses.
|
||||
if len(splitPath(path)) == 0 {
|
||||
return -eNOSYS, ""
|
||||
}
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status), ""
|
||||
}
|
||||
defer ref.release()
|
||||
target, status := w.wfs.Readlink(never, ptr(w.caller(inode)))
|
||||
if status != fuse.OK {
|
||||
return toErrno(status), ""
|
||||
}
|
||||
return 0, string(target)
|
||||
}
|
||||
|
||||
// Symlink is refused for now. The entry is easy to create, but WinFsp only
|
||||
// follows it once the reparse point is wired up, so it would otherwise read
|
||||
// back as an empty file.
|
||||
func (w *WinFS) Symlink(target string, newpath string) int {
|
||||
return -eNOSYS
|
||||
}
|
||||
|
||||
// Chown accepts and discards. Windows has no uid to record, but WinFsp passes
|
||||
// a chown failure straight out of SetSecurity, so refusing it breaks Explorer's
|
||||
// Security tab and icacls for changes that are not about ownership at all.
|
||||
func (w *WinFS) Chown(path string, uid uint32, gid uint32) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Link is not implemented: WinFsp has no hard links.
|
||||
func (w *WinFS) Link(oldpath string, newpath string) int {
|
||||
return -eNOSYS
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
cgofuse "github.com/winfsp/cgofuse/fuse"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount"
|
||||
)
|
||||
|
||||
// Options are the WinFsp-specific knobs the mount command passes through.
|
||||
type Options struct {
|
||||
// VolumeName labels the drive in Explorer.
|
||||
VolumeName string
|
||||
|
||||
// Uid and Gid are reported for every entry. WinFsp overrides what is
|
||||
// reported anyway (see the uid=-1 option below), so these are what gets
|
||||
// written to the filer and read by every other client.
|
||||
Uid uint32
|
||||
Gid uint32
|
||||
|
||||
// AttrTimeout bounds how long WinFsp caches attributes, in seconds.
|
||||
// Nothing invalidates its cache, so this is the only coherence knob.
|
||||
AttrTimeout float64
|
||||
|
||||
// ReadOnly rejects every modification. WinFsp has no "ro" option — it
|
||||
// discards the flag and leaves the volume writable — so the refusal has
|
||||
// to happen in the operations themselves.
|
||||
ReadOnly bool
|
||||
|
||||
// Debug turns on cgofuse's operation trace.
|
||||
Debug bool
|
||||
|
||||
// ExtraOptions are passed through to WinFsp as -o arguments.
|
||||
ExtraOptions []string
|
||||
}
|
||||
|
||||
// Host is a WinFsp mount that has not been started yet.
|
||||
type Host struct {
|
||||
host *cgofuse.FileSystemHost
|
||||
options Options
|
||||
}
|
||||
|
||||
// New wires wfs up to WinFsp. Nothing is mounted until Serve.
|
||||
func New(wfs *mount.WFS, options Options) *Host {
|
||||
host := cgofuse.NewFileSystemHost(NewWinFS(wfs, options.Uid, options.Gid, options.ReadOnly))
|
||||
host.SetCapReaddirPlus(true)
|
||||
host.SetUseIno(true)
|
||||
return &Host{host: host, options: options}
|
||||
}
|
||||
|
||||
// Notify wires the mount's metadata events to Windows. Called once before
|
||||
// Serve; the host has to exist first, which is why it is not done in New.
|
||||
func (h *Host) Notify(wfs *mount.WFS) {
|
||||
n := ¬ifier{host: h.host, mountRoot: wfs.MountRoot()}
|
||||
wfs.SetEntryChangeListener(n.notify)
|
||||
}
|
||||
|
||||
// Serve attaches the filesystem at mountPoint, which is a drive letter ("S:"),
|
||||
// a directory that does not yet exist, or a UNC path. It blocks until the
|
||||
// filesystem is unmounted.
|
||||
func (h *Host) Serve(mountPoint string) error {
|
||||
opts := []string{
|
||||
"-o", "volname=" + h.volumeName(),
|
||||
"-o", "uid=-1",
|
||||
"-o", "gid=-1",
|
||||
}
|
||||
if h.options.AttrTimeout > 0 {
|
||||
timeout := strconv.FormatFloat(h.options.AttrTimeout, 'f', -1, 64)
|
||||
opts = append(opts, "-o", "attr_timeout="+timeout, "-o", "entry_timeout="+timeout)
|
||||
}
|
||||
if h.options.Debug {
|
||||
opts = append(opts, "-d")
|
||||
}
|
||||
for _, extra := range h.options.ExtraOptions {
|
||||
opts = append(opts, "-o", extra)
|
||||
}
|
||||
|
||||
if err := h.mount(mountPoint, opts); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// mount turns a refusal into an error. cgofuse panics rather than returning
|
||||
// when winfsp-x64.dll is missing, which is the most likely reason for a
|
||||
// failure here and the one worth naming.
|
||||
func (h *Host) mount(mountPoint string, opts []string) (err error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = fmt.Errorf("mounting %s failed (%v); is WinFsp installed?", mountPoint, r)
|
||||
}
|
||||
}()
|
||||
if !h.host.Mount(mountPoint, opts) {
|
||||
return fmt.Errorf("WinFsp refused to mount %s; check that WinFsp is installed and the mount point is free", mountPoint)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Unmount detaches the filesystem, releasing a blocked Serve.
|
||||
func (h *Host) Unmount() bool {
|
||||
return h.host.Unmount()
|
||||
}
|
||||
|
||||
// volumeName keeps the label parseable: WinFsp splits options on commas, so a
|
||||
// label carrying one would be cut short and take the rest of the option string
|
||||
// with it.
|
||||
func (h *Host) volumeName() string {
|
||||
name := strings.ReplaceAll(h.options.VolumeName, ",", "+")
|
||||
if name == "" {
|
||||
return "SeaweedFS"
|
||||
}
|
||||
return name
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
// relativeToMount rebases a filer path onto the mount root. Metadata events
|
||||
// cover the whole subscription, so a path outside this mount is not ours to
|
||||
// report, and a sibling whose name merely starts with the root is not inside
|
||||
// it either.
|
||||
func relativeToMount(root, path util.FullPath) (string, bool) {
|
||||
full, prefix := string(path), string(root)
|
||||
if prefix == "" || prefix == "/" {
|
||||
return full, full != ""
|
||||
}
|
||||
if full == prefix {
|
||||
return "/", true
|
||||
}
|
||||
if !strings.HasPrefix(full, prefix+"/") {
|
||||
return "", false
|
||||
}
|
||||
return full[len(prefix):], true
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
// Event paths are absolute on the filer and cover the whole subscription, so
|
||||
// rebasing them decides both what Windows is told and what is none of its
|
||||
// business.
|
||||
func TestRelativeToMount(t *testing.T) {
|
||||
cases := []struct {
|
||||
root string
|
||||
path string
|
||||
want string
|
||||
ok bool
|
||||
}{
|
||||
{"/", "/a/b.txt", "/a/b.txt", true},
|
||||
{"", "/a/b.txt", "/a/b.txt", true},
|
||||
{"/buckets/data", "/buckets/data/a/b.txt", "/a/b.txt", true},
|
||||
{"/buckets/data", "/buckets/data", "/", true},
|
||||
{"/buckets/data", "/buckets/other/b.txt", "", false},
|
||||
// A sibling whose name merely starts with the root must not match.
|
||||
{"/buckets/data", "/buckets/data2/b.txt", "", false},
|
||||
{"/buckets/data", "/elsewhere", "", false},
|
||||
}
|
||||
for _, c := range cases {
|
||||
got, ok := relativeToMount(util.FullPath(c.root), util.FullPath(c.path))
|
||||
if ok != c.ok || (ok && got != c.want) {
|
||||
t.Errorf("root %q path %q = (%q, %v), want (%q, %v)", c.root, c.path, got, ok, c.want, c.ok)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
cgofuse "github.com/winfsp/cgofuse/fuse"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
// notifier turns the mount's metadata events into the notifications Windows
|
||||
// listens for. Nothing invalidates a Windows client's cache from this side, so
|
||||
// without it a change made by another mount, the S3 gateway or the filer API
|
||||
// stays invisible until the user refreshes by hand.
|
||||
type notifier struct {
|
||||
host *cgofuse.FileSystemHost
|
||||
mountRoot util.FullPath
|
||||
}
|
||||
|
||||
// notify reports one applied event. Windows wants the path relative to the
|
||||
// mount, and an action describing what happened to it.
|
||||
func (n *notifier) notify(invalidation meta_cache.EntryInvalidation) {
|
||||
if n.host == nil {
|
||||
return
|
||||
}
|
||||
// A rename arrives as two invalidations, one vacating the old path and one
|
||||
// describing the new, so reporting RenamedTo here as well would send the
|
||||
// destination twice — and as a create even when a directory moved.
|
||||
if path, ok := relativeToMount(n.mountRoot, invalidation.Path); ok {
|
||||
n.send(path, n.action(invalidation))
|
||||
}
|
||||
}
|
||||
|
||||
func (n *notifier) send(path string, action uint32) {
|
||||
if !n.host.Notify(path, action) {
|
||||
// A rejected notification only costs a stale view until the client
|
||||
// looks again, so it is not worth failing an operation over.
|
||||
glog.V(4).Infof("winfsp notify %s action %d rejected", path, action)
|
||||
}
|
||||
}
|
||||
|
||||
// action picks what to tell Windows happened. It cannot distinguish a created
|
||||
// entry from a modified one, and Windows treats an unexpected create on an
|
||||
// existing name as a refresh, so create is the safe report.
|
||||
func (n *notifier) action(invalidation meta_cache.EntryInvalidation) uint32 {
|
||||
if invalidation.Deleted || invalidation.Entry == nil {
|
||||
// The entry is gone, so only WasDirectory still says what it was, and
|
||||
// Windows watches directory and file removals through different
|
||||
// filters.
|
||||
if invalidation.WasDirectory {
|
||||
return cgofuse.NOTIFY_RMDIR
|
||||
}
|
||||
return cgofuse.NOTIFY_UNLINK
|
||||
}
|
||||
if invalidation.Entry.GetIsDirectory() {
|
||||
return cgofuse.NOTIFY_MKDIR
|
||||
}
|
||||
return cgofuse.NOTIFY_CREATE
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package winfsp
|
||||
|
||||
import "strings"
|
||||
|
||||
// splitPath breaks a WinFsp path into the components to walk. WinFsp normally
|
||||
// hands out forward slashes, but callers reach the mount with either separator,
|
||||
// and empty or "." components have to drop out rather than become a lookup for
|
||||
// a name that does not exist.
|
||||
func splitPath(path string) []string {
|
||||
trimmed := strings.Trim(strings.ReplaceAll(path, `\`, "/"), "/")
|
||||
if trimmed == "" {
|
||||
return nil
|
||||
}
|
||||
parts := make([]string, 0, strings.Count(trimmed, "/")+1)
|
||||
for _, name := range strings.Split(trimmed, "/") {
|
||||
if name == "" || name == "." {
|
||||
continue
|
||||
}
|
||||
parts = append(parts, name)
|
||||
}
|
||||
return parts
|
||||
}
|
||||
|
||||
// splitParent separates the components leading up to the final name, which the
|
||||
// create and delete operations need apart. ok is false for the root, which has
|
||||
// no parent to operate in.
|
||||
func splitParent(path string) (parent []string, name string, ok bool) {
|
||||
parts := splitPath(path)
|
||||
if len(parts) == 0 {
|
||||
return nil, "", false
|
||||
}
|
||||
return parts[:len(parts)-1], parts[len(parts)-1], true
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSplitPath(t *testing.T) {
|
||||
cases := []struct {
|
||||
in string
|
||||
want []string
|
||||
}{
|
||||
{"/", nil},
|
||||
{"", nil},
|
||||
{"//", nil},
|
||||
{".", nil},
|
||||
{"/foo", []string{"foo"}},
|
||||
{"foo", []string{"foo"}},
|
||||
{"/foo/", []string{"foo"}},
|
||||
{"/foo/bar", []string{"foo", "bar"}},
|
||||
{"/foo//bar", []string{"foo", "bar"}},
|
||||
{"/foo/./bar", []string{"foo", "bar"}},
|
||||
{`\foo\bar`, []string{"foo", "bar"}},
|
||||
{`/foo\bar`, []string{"foo", "bar"}},
|
||||
{"/foo bar/baz qux", []string{"foo bar", "baz qux"}},
|
||||
{"/eñe/日本", []string{"eñe", "日本"}},
|
||||
// ".." is a name like any other here; the filer resolves it, and
|
||||
// treating it structurally would let a path escape the mount root.
|
||||
{"/foo/../bar", []string{"foo", "..", "bar"}},
|
||||
}
|
||||
for _, c := range cases {
|
||||
got := splitPath(c.in)
|
||||
if len(got) != len(c.want) {
|
||||
t.Errorf("splitPath(%q) = %v, want %v", c.in, got, c.want)
|
||||
continue
|
||||
}
|
||||
for i := range got {
|
||||
if got[i] != c.want[i] {
|
||||
t.Errorf("splitPath(%q) = %v, want %v", c.in, got, c.want)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSplitParent(t *testing.T) {
|
||||
cases := []struct {
|
||||
in string
|
||||
wantParent string
|
||||
wantName string
|
||||
wantOK bool
|
||||
}{
|
||||
{"/", "", "", false},
|
||||
{"", "", "", false},
|
||||
{"/foo", "", "foo", true},
|
||||
{"/foo/bar", "foo", "bar", true},
|
||||
{"/foo/bar/baz", "foo/bar", "baz", true},
|
||||
{`\foo\bar`, "foo", "bar", true},
|
||||
{"/foo/bar/", "foo", "bar", true},
|
||||
}
|
||||
for _, c := range cases {
|
||||
parent, name, ok := splitParent(c.in)
|
||||
if ok != c.wantOK || name != c.wantName || strings.Join(parent, "/") != c.wantParent {
|
||||
t.Errorf("splitParent(%q) = (%q, %q, %v), want (%q, %q, %v)",
|
||||
c.in, strings.Join(parent, "/"), name, ok, c.wantParent, c.wantName, c.wantOK)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The root has no parent, so operations that need one must be rejected rather
|
||||
// than silently acting on the root itself.
|
||||
func TestSplitParentRejectsRoot(t *testing.T) {
|
||||
for _, root := range []string{"/", "", "//", `\`} {
|
||||
if _, _, ok := splitParent(root); ok {
|
||||
t.Errorf("splitParent(%q) accepted the root", root)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package winfsp
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/seaweedfs/go-fuse/v2/fuse"
|
||||
)
|
||||
|
||||
// xattrBufferSize bounds one attribute value and one name listing. The mount
|
||||
// stores extended attributes in the entry itself, so they are small by
|
||||
// construction; this is the ceiling WinFsp will accept in a single reply.
|
||||
const xattrBufferSize = 64 * 1024
|
||||
|
||||
func (w *WinFS) Getxattr(path string, name string) (int, []byte) {
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status), nil
|
||||
}
|
||||
defer ref.release()
|
||||
|
||||
dest := make([]byte, xattrBufferSize)
|
||||
size, status := w.wfs.GetXAttr(never, ptr(w.caller(inode)), name, dest)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status), nil
|
||||
}
|
||||
return 0, dest[:size]
|
||||
}
|
||||
|
||||
func (w *WinFS) Setxattr(path string, name string, value []byte, flags int) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
|
||||
// cgofuse and the raw filesystem number XATTR_CREATE and XATTR_REPLACE the
|
||||
// same, so the flags pass straight through; TestXattrFlagValues pins that.
|
||||
in := &fuse.SetXAttrIn{InHeader: w.caller(inode)}
|
||||
in.Flags = uint32(flags)
|
||||
in.Size = uint32(len(value))
|
||||
return toErrno(w.wfs.SetXAttr(never, in, name, value))
|
||||
}
|
||||
|
||||
func (w *WinFS) Removexattr(path string, name string) int {
|
||||
if w.denied() {
|
||||
return -eROFS
|
||||
}
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
return toErrno(w.wfs.RemoveXAttr(never, ptr(w.caller(inode)), name))
|
||||
}
|
||||
|
||||
func (w *WinFS) Listxattr(path string, fill func(name string) bool) int {
|
||||
inode, ref, status := w.resolve(path)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
defer ref.release()
|
||||
|
||||
dest := make([]byte, xattrBufferSize)
|
||||
size, status := w.wfs.ListXAttr(never, ptr(w.caller(inode)), dest)
|
||||
if status != fuse.OK {
|
||||
return toErrno(status)
|
||||
}
|
||||
for _, name := range splitXattrNames(dest[:size]) {
|
||||
if !fill(name) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// splitXattrNames unpacks the NUL-separated listing the raw filesystem
|
||||
// produces. A trailing NUL terminates the last name rather than starting an
|
||||
// empty one.
|
||||
func splitXattrNames(packed []byte) []string {
|
||||
var names []string
|
||||
for _, name := range bytes.Split(packed, []byte{0}) {
|
||||
if len(name) > 0 {
|
||||
names = append(names, string(name))
|
||||
}
|
||||
}
|
||||
return names
|
||||
}
|
||||
@@ -71,6 +71,15 @@ func UploadReaderInChunks(ctx context.Context, reader io.Reader, opt *ChunkedUpl
|
||||
const bytesBufferCounter = 4
|
||||
bytesBufferLimitChan := make(chan struct{}, bytesBufferCounter)
|
||||
|
||||
// objectFailed reports whether another chunk has already doomed the upload,
|
||||
// so an in-flight chunk stops spending its retry budget on bytes nobody
|
||||
// will reference.
|
||||
objectFailed := func() bool {
|
||||
uploadErrLock.Lock()
|
||||
defer uploadErrLock.Unlock()
|
||||
return uploadErr != nil
|
||||
}
|
||||
|
||||
uploadLoop:
|
||||
for {
|
||||
// Throttle buffer usage
|
||||
@@ -192,35 +201,31 @@ uploadLoop:
|
||||
var uploadResult *UploadResult
|
||||
var uploadResultErr error
|
||||
|
||||
holders := chunkHolders(assignResult)
|
||||
// Fan out to every holder, except for cipher: per-call encryption
|
||||
// would give each replica different bytes, so keep its relay path.
|
||||
if opt.UploadFunc == nil && !opt.Cipher && len(holders) > 1 {
|
||||
uploadResult, uploadResultErr = uploadChunkToHolders(ctx, holders, assignResult.Fid, buf.Bytes(), jwt, chunkMd5B64, opt)
|
||||
} else {
|
||||
uploadOption := &UploadOption{
|
||||
UploadUrl: fmt.Sprintf("http://%s/%s", assignResult.Url, assignResult.Fid),
|
||||
Cipher: opt.Cipher,
|
||||
IsInputCompressed: false,
|
||||
MimeType: opt.MimeType,
|
||||
PairMap: nil,
|
||||
Jwt: jwt,
|
||||
Md5: chunkMd5B64,
|
||||
// A target that fills up, loses its replica peer, or goes away fails
|
||||
// every attempt against the same fid, so ask for a fresh assignment and
|
||||
// retry there rather than losing the whole object to one bad volume.
|
||||
for attempt := 1; ; attempt++ {
|
||||
uploadResult, uploadResultErr = uploadChunk(ctx, assignResult, buf.Bytes(), jwt, chunkMd5B64, opt)
|
||||
if uploadResultErr == nil {
|
||||
break
|
||||
}
|
||||
// Use mock upload function if provided (for testing), otherwise use real uploader
|
||||
if opt.UploadFunc != nil {
|
||||
uploadResult, uploadResultErr = opt.UploadFunc(ctx, buf.Bytes(), uploadOption)
|
||||
} else {
|
||||
uploader, uploaderErr := NewUploader()
|
||||
if uploaderErr != nil {
|
||||
uploadErrLock.Lock()
|
||||
if uploadErr == nil {
|
||||
uploadErr = fmt.Errorf("create uploader: %w", uploaderErr)
|
||||
}
|
||||
uploadErrLock.Unlock()
|
||||
return
|
||||
}
|
||||
uploadResult, uploadResultErr = uploader.UploadData(ctx, buf.Bytes(), uploadOption)
|
||||
// The volume server commits the needle before replicating, so a
|
||||
// failed write can still leave a copy behind. No chunk will name
|
||||
// this fid whether we retry or give up here, and an unreferenced
|
||||
// needle is not garbage vacuum can find, so drop it either way.
|
||||
deleteChunkFromHolders(chunkHolders(assignResult), assignResult.Fid, jwt)
|
||||
if attempt == chunkAssignAttempts || !shouldReassignUpload(uploadResultErr) || objectFailed() {
|
||||
break
|
||||
}
|
||||
glog.V(2).Infof("re-assigning chunk at offset %d after attempt %d/%d: %v", offset, attempt, chunkAssignAttempts, uploadResultErr)
|
||||
_, assignResult, assignErr = opt.AssignFunc(ctx, 1, uint64(size))
|
||||
if assignErr != nil {
|
||||
uploadResultErr = fmt.Errorf("reassign volume after %w: %w", uploadResultErr, assignErr)
|
||||
break
|
||||
}
|
||||
jwt = opt.Jwt
|
||||
if assignResult.Auth != "" {
|
||||
jwt = assignResult.Auth
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,6 +296,46 @@ uploadLoop:
|
||||
}, nil
|
||||
}
|
||||
|
||||
// chunkAssignAttempts bounds how many volumes one chunk may be offered to
|
||||
// before the upload gives up.
|
||||
const chunkAssignAttempts = 3
|
||||
|
||||
// uploadChunk writes one chunk to its assigned volume. It fans out to every
|
||||
// holder, except for cipher: per-call encryption would give each replica
|
||||
// different bytes, so keep its relay path.
|
||||
func uploadChunk(ctx context.Context, assignResult *AssignResult, data []byte, jwt security.EncodedJwt, md5b64 string, opt *ChunkedUploadOption) (*UploadResult, error) {
|
||||
holders := chunkHolders(assignResult)
|
||||
if opt.UploadFunc == nil && !opt.Cipher && len(holders) > 1 {
|
||||
return uploadChunkToHolders(ctx, holders, assignResult.Fid, data, jwt, md5b64, opt)
|
||||
}
|
||||
uploadOption := &UploadOption{
|
||||
UploadUrl: fmt.Sprintf("http://%s/%s", assignResult.Url, assignResult.Fid),
|
||||
Cipher: opt.Cipher,
|
||||
IsInputCompressed: false,
|
||||
MimeType: opt.MimeType,
|
||||
PairMap: nil,
|
||||
Jwt: jwt,
|
||||
Md5: md5b64,
|
||||
// One upload call per assignment: the caller retries everything a
|
||||
// same-URL retry would, and a different volume is the better second try.
|
||||
// This bounds retriedUploadData only — doUploadData still reissues once
|
||||
// on a connection reset, with a rewound body, which is a transport
|
||||
// stutter rather than a fresh attempt at the volume. The fan-out path
|
||||
// keeps its retries, where absorbing a blip locally beats cancelling
|
||||
// every holder and re-uploading the chunk.
|
||||
MaxAttempts: 1,
|
||||
}
|
||||
// Use mock upload function if provided (for testing), otherwise use real uploader
|
||||
if opt.UploadFunc != nil {
|
||||
return opt.UploadFunc(ctx, data, uploadOption)
|
||||
}
|
||||
uploader, err := NewUploader()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create uploader: %w", err)
|
||||
}
|
||||
return uploader.UploadData(ctx, data, uploadOption)
|
||||
}
|
||||
|
||||
// chunkHolders returns the assigned volume plus its replica holders.
|
||||
func chunkHolders(assignResult *AssignResult) []string {
|
||||
hosts := []string{assignResult.Url}
|
||||
@@ -341,9 +386,15 @@ func uploadChunkToHolders(ctx context.Context, hosts []string, fid string, data
|
||||
for range hosts {
|
||||
o := <-outcomes
|
||||
if o.err != nil {
|
||||
// Once one holder fails the rest are cancelled, so errors arrive in
|
||||
// no fixed order. Prefer one the caller can act on, or the choice of
|
||||
// which host to report — and whether to retry elsewhere — turns on
|
||||
// goroutine scheduling.
|
||||
if firstErr == nil {
|
||||
firstErr = o.err
|
||||
cancel()
|
||||
} else if !shouldReassignUpload(firstErr) && shouldReassignUpload(o.err) {
|
||||
firstErr = o.err
|
||||
}
|
||||
} else {
|
||||
succeeded = append(succeeded, o.host)
|
||||
|
||||
@@ -13,6 +13,8 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/security"
|
||||
)
|
||||
|
||||
// TestUploadReaderInChunksReturnsPartialResultsOnError verifies that when
|
||||
@@ -415,3 +417,225 @@ func TestUploadReaderInChunksTagsTruncatedBody(t *testing.T) {
|
||||
t.Errorf("expected io.ErrUnexpectedEOF to remain in the chain, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// uploadSingleChunk runs a single-chunk upload against uploadFunc, handing out a
|
||||
// fresh volume on every assignment, and reports how many assignments it took.
|
||||
func uploadSingleChunk(t *testing.T, uploadFunc func(ctx context.Context, data []byte, option *UploadOption) (*UploadResult, error)) (*ChunkedUploadResult, int, error) {
|
||||
t.Helper()
|
||||
|
||||
assigns := 0
|
||||
assignFunc := func(ctx context.Context, count int, expectedDataSize uint64) (*VolumeAssignRequest, *AssignResult, error) {
|
||||
assigns++
|
||||
return nil, &AssignResult{
|
||||
Fid: fmt.Sprintf("%d,0a0b0c0d", assigns),
|
||||
Url: fmt.Sprintf("volume-%d:8080", assigns),
|
||||
Auth: security.EncodedJwt(fmt.Sprintf("jwt-%d", assigns)),
|
||||
Count: 1,
|
||||
}, nil
|
||||
}
|
||||
|
||||
result, err := UploadReaderInChunks(context.Background(), bytes.NewReader(bytes.Repeat([]byte("x"), 4096)), &ChunkedUploadOption{
|
||||
ChunkSize: 8 * 1024,
|
||||
Collection: "test",
|
||||
AssignFunc: assignFunc,
|
||||
UploadFunc: uploadFunc,
|
||||
})
|
||||
return result, assigns, err
|
||||
}
|
||||
|
||||
// A volume at capacity answers every attempt against the same fid with a 500,
|
||||
// so the chunk has to move to a freshly assigned volume rather than take the
|
||||
// whole object down with it.
|
||||
func TestUploadReaderInChunksReassignsOnFullVolume(t *testing.T) {
|
||||
var jwts []security.EncodedJwt
|
||||
result, assigns, err := uploadSingleChunk(t, func(ctx context.Context, data []byte, option *UploadOption) (*UploadResult, error) {
|
||||
jwts = append(jwts, option.Jwt)
|
||||
if strings.Contains(option.UploadUrl, "volume-1:") {
|
||||
return nil, &uploadStatusError{
|
||||
StatusCode: http.StatusInternalServerError,
|
||||
err: errors.New("failed to write to local disk: Volume Size 34361499680 Exceeded 34359738368"),
|
||||
}
|
||||
}
|
||||
return &UploadResult{Size: uint32(len(data))}, nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("expected the chunk to land on the reassigned volume, got %v", err)
|
||||
}
|
||||
if assigns != 2 {
|
||||
t.Fatalf("expected 2 assignments, got %d", assigns)
|
||||
}
|
||||
// A secured cluster mints a JWT per assignment; presenting the full volume's
|
||||
// token to the new one would 401.
|
||||
if len(jwts) != 2 || jwts[0] != "jwt-1" || jwts[1] != "jwt-2" {
|
||||
t.Errorf("expected each attempt to carry its own assignment JWT, got %v", jwts)
|
||||
}
|
||||
if len(result.FileChunks) != 1 {
|
||||
t.Fatalf("expected 1 chunk, got %d", len(result.FileChunks))
|
||||
}
|
||||
if got := result.FileChunks[0].FileId; got != "2,0a0b0c0d" {
|
||||
t.Errorf("expected the chunk to record the reassigned fid, got %s", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUploadReaderInChunksDoesNotReassignOnClientError(t *testing.T) {
|
||||
_, assigns, err := uploadSingleChunk(t, func(ctx context.Context, data []byte, option *UploadOption) (*UploadResult, error) {
|
||||
return nil, &uploadStatusError{StatusCode: http.StatusBadRequest, err: errors.New("mismatching cookie")}
|
||||
})
|
||||
|
||||
if err == nil {
|
||||
t.Fatal("expected a 4xx to fail the upload")
|
||||
}
|
||||
// Another volume would reject the same request the same way.
|
||||
if assigns != 1 {
|
||||
t.Fatalf("expected 1 assignment, got %d", assigns)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUploadReaderInChunksBoundsReassignment(t *testing.T) {
|
||||
_, assigns, err := uploadSingleChunk(t, func(ctx context.Context, data []byte, option *UploadOption) (*UploadResult, error) {
|
||||
return nil, &uploadStatusError{StatusCode: http.StatusInternalServerError, err: errors.New("volume full")}
|
||||
})
|
||||
|
||||
if err == nil {
|
||||
t.Fatal("expected the upload to fail once every volume it is offered is full")
|
||||
}
|
||||
// Spelled out rather than compared to chunkAssignAttempts: the budget is
|
||||
// what bounds this against retriedUploadData's own attempts, so raising it
|
||||
// should fail here, not pass silently.
|
||||
if assigns != 3 {
|
||||
t.Fatalf("expected 3 assignments, got %d", assigns)
|
||||
}
|
||||
}
|
||||
|
||||
// The fan-out path is what a real multi-replica cluster takes, and it behaves
|
||||
// differently from the relay path under failure: it cancels its siblings and
|
||||
// rolls back the copies that landed. Drive the reassignment loop through it.
|
||||
func TestUploadReaderInChunksReassignsAcrossHolders(t *testing.T) {
|
||||
var primaryDeletes, fullDeletes int32
|
||||
|
||||
healthy := func(deletes *int32) *httptest.Server {
|
||||
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method == http.MethodDelete {
|
||||
atomic.AddInt32(deletes, 1)
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
return
|
||||
}
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
fmt.Fprint(w, `{"name":"chunk","size":4096}`)
|
||||
}))
|
||||
}
|
||||
|
||||
full := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method == http.MethodDelete {
|
||||
atomic.AddInt32(&fullDeletes, 1)
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
return
|
||||
}
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
fmt.Fprint(w, `{"error":"failed to write to local disk: Volume Size 34361499680 Exceeded 34359738368"}`)
|
||||
}))
|
||||
defer full.Close()
|
||||
|
||||
var secondaryDeletes int32
|
||||
primary, secondary := healthy(&primaryDeletes), healthy(&secondaryDeletes)
|
||||
defer primary.Close()
|
||||
defer secondary.Close()
|
||||
|
||||
host := func(s *httptest.Server) string { return strings.TrimPrefix(s.URL, "http://") }
|
||||
|
||||
assigns := 0
|
||||
assignFunc := func(ctx context.Context, count int, expectedDataSize uint64) (*VolumeAssignRequest, *AssignResult, error) {
|
||||
assigns++
|
||||
if assigns == 1 {
|
||||
// Two holders, so uploadChunk takes the fan-out path; one is full.
|
||||
return nil, &AssignResult{
|
||||
Fid: "1,0a0b0c0d",
|
||||
Url: host(primary),
|
||||
Replicas: []Location{{Url: host(full)}},
|
||||
Count: 1,
|
||||
}, nil
|
||||
}
|
||||
return nil, &AssignResult{
|
||||
Fid: "2,0a0b0c0d",
|
||||
Url: host(primary),
|
||||
Replicas: []Location{{Url: host(secondary)}},
|
||||
Count: 1,
|
||||
}, nil
|
||||
}
|
||||
|
||||
result, err := UploadReaderInChunks(context.Background(), bytes.NewReader(bytes.Repeat([]byte("x"), 4096)), &ChunkedUploadOption{
|
||||
ChunkSize: 8 * 1024,
|
||||
Collection: "test",
|
||||
AssignFunc: assignFunc,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
t.Fatalf("expected the chunk to land on the reassigned volume, got %v", err)
|
||||
}
|
||||
if assigns != 2 {
|
||||
t.Fatalf("expected 2 assignments, got %d", assigns)
|
||||
}
|
||||
if len(result.FileChunks) != 1 || result.FileChunks[0].FileId != "2,0a0b0c0d" {
|
||||
t.Fatalf("expected the chunk to record the reassigned fid, got %+v", result.FileChunks)
|
||||
}
|
||||
// The copy that landed on the healthy holder before its peer reported full
|
||||
// is referenced by nothing, so it has to be rolled back.
|
||||
if atomic.LoadInt32(&primaryDeletes) == 0 {
|
||||
t.Error("expected the copy that landed to be rolled back")
|
||||
}
|
||||
// The full holder is not in uploadChunkToHolders' succeeded set, so only the
|
||||
// loop's own rollback reaches it — and it has to, because a 5xx there can
|
||||
// still mean the needle was committed before replication failed.
|
||||
if atomic.LoadInt32(&fullDeletes) == 0 {
|
||||
t.Error("expected the abandoned fid to be deleted from the failed holder too")
|
||||
}
|
||||
if atomic.LoadInt32(&secondaryDeletes) != 0 {
|
||||
t.Error("the reassigned volume kept the chunk; it must not be rolled back")
|
||||
}
|
||||
}
|
||||
|
||||
// retriedUploadData retries the same URL three times by default. On the relay
|
||||
// path the reassignment loop retries everything that would, so leaving both in
|
||||
// place would multiply into nine upload calls for one chunk.
|
||||
//
|
||||
// This counts calls that reached a handler and answered. doUploadData reissues
|
||||
// once more on a connection reset before any of them return, which no HTTP
|
||||
// status can provoke; upload_content_test covers that separately.
|
||||
func TestUploadReaderInChunksDoesNotMultiplyRelayAttempts(t *testing.T) {
|
||||
var posts, deletes int32
|
||||
dead := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method == http.MethodDelete {
|
||||
atomic.AddInt32(&deletes, 1)
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
return
|
||||
}
|
||||
atomic.AddInt32(&posts, 1)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
fmt.Fprint(w, `{"error":"failed to write to local disk: Volume Size 34361499680 Exceeded 34359738368"}`)
|
||||
}))
|
||||
defer dead.Close()
|
||||
|
||||
assigns := 0
|
||||
_, err := UploadReaderInChunks(context.Background(), bytes.NewReader(bytes.Repeat([]byte("x"), 4096)), &ChunkedUploadOption{
|
||||
ChunkSize: 8 * 1024,
|
||||
Collection: "test",
|
||||
AssignFunc: func(ctx context.Context, count int, expectedDataSize uint64) (*VolumeAssignRequest, *AssignResult, error) {
|
||||
assigns++
|
||||
// One holder, so uploadChunk takes the relay path.
|
||||
return nil, &AssignResult{Fid: fmt.Sprintf("%d,0a0b0c0d", assigns), Url: strings.TrimPrefix(dead.URL, "http://"), Count: 1}, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err == nil {
|
||||
t.Fatal("expected the upload to fail once every volume it is offered is full")
|
||||
}
|
||||
if got := atomic.LoadInt32(&posts); got != 3 {
|
||||
t.Errorf("expected 3 upload calls, one per assignment, got %d", got)
|
||||
}
|
||||
// Including the last one: giving up does not make the needle it may have
|
||||
// committed anyone else's to find, and no chunk will ever name that fid.
|
||||
if got := atomic.LoadInt32(&deletes); got != 3 {
|
||||
t.Errorf("expected every abandoned fid to be rolled back, got %d deletes", got)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package placement
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/storage/types"
|
||||
)
|
||||
|
||||
// PlacementPreference describes where a volume that has to leave its current
|
||||
// node may land.
|
||||
type PlacementPreference struct {
|
||||
// Source is the node the volume is leaving. It is never a candidate, and
|
||||
// its rack and data center are what PreferLocality measures against.
|
||||
Source string
|
||||
// DiskType is the medium the volume must land on.
|
||||
DiskType types.DiskType
|
||||
// AnchorDataCenter restricts candidates to one data center when set.
|
||||
AnchorDataCenter string
|
||||
// Exclude names nodes already spoken for by the same plan, so a caller
|
||||
// placing several copies does not stack them on one node.
|
||||
Exclude map[string]bool
|
||||
// Accept rejects candidates the caller cannot use for reasons placement does
|
||||
// not model -- replica placement rules, a node already holding the volume.
|
||||
// It receives the candidate's rack and data center because the constraints
|
||||
// that need them are exactly the ones a bare node cannot express. Nil
|
||||
// accepts everything.
|
||||
Accept func(node *master_pb.DataNodeInfo, dataCenter, rack string) bool
|
||||
// VolumeBytes is what this move will actually consume on the destination.
|
||||
// Zero falls back to the tier's average volume size, which is all a caller
|
||||
// planning a not-yet-created volume can know.
|
||||
VolumeBytes uint64
|
||||
}
|
||||
|
||||
// PickTarget chooses where a volume that has to leave its node should land:
|
||||
// the emptiest node near it.
|
||||
//
|
||||
// Locality ranks first -- same rack as the source, then same data center, then
|
||||
// anywhere -- because moving a volume past a node that could have held it costs
|
||||
// cross-rack bandwidth for nothing. Within a locality tier the emptiest wins, so
|
||||
// a burst of moves still spreads instead of filling whichever node the topology
|
||||
// happens to list first. Free bytes decide when the cluster reports them and
|
||||
// free slots break the tie, which also leaves servers too old to report
|
||||
// filesystem bytes ordered sensibly.
|
||||
//
|
||||
// Locality is not optional. A caller that genuinely wants to scatter should
|
||||
// widen what it passes as Source, not ask placement to forget where the volume
|
||||
// came from.
|
||||
//
|
||||
// The chosen node's volume count is spent in topo before returning. Planning
|
||||
// several moves from one snapshot otherwise sends them all to the same node,
|
||||
// since each pick would see the capacity its predecessors already took. Callers
|
||||
// therefore pass a snapshot they own and may mutate.
|
||||
func PickTarget(topo *master_pb.TopologyInfo, pref PlacementPreference) *master_pb.DataNodeInfo {
|
||||
nodes := candidateNodes(topo, pref.AnchorDataCenter)
|
||||
|
||||
var srcDc, srcRack string
|
||||
for _, n := range nodes {
|
||||
if n.info.Id == pref.Source {
|
||||
srcDc, srcRack = n.dc, n.rack
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
type candidate struct {
|
||||
node *node
|
||||
locality int // 0 same rack, 1 same dc, 2 elsewhere
|
||||
bytes uint64
|
||||
hasBytes bool
|
||||
slots int64
|
||||
}
|
||||
|
||||
var candidates []candidate
|
||||
for _, n := range nodes {
|
||||
if n.info.Id == pref.Source || pref.Exclude[n.info.Id] {
|
||||
continue
|
||||
}
|
||||
d := n.disk(pref.DiskType)
|
||||
if d == nil || d.VolumeCount >= d.MaxVolumeCount {
|
||||
continue
|
||||
}
|
||||
if pref.Accept != nil && !pref.Accept(n.info, n.dc, n.rack) {
|
||||
continue
|
||||
}
|
||||
c := candidate{node: n}
|
||||
c.bytes, c.hasBytes = d.DiskFreeBytes, d.DiskTotalBytes != 0
|
||||
c.slots = d.MaxVolumeCount - d.VolumeCount
|
||||
switch {
|
||||
case srcRack != "" && n.rack == srcRack && n.dc == srcDc:
|
||||
c.locality = 0
|
||||
case srcDc != "" && n.dc == srcDc:
|
||||
c.locality = 1
|
||||
default:
|
||||
c.locality = 2
|
||||
}
|
||||
candidates = append(candidates, c)
|
||||
}
|
||||
if len(candidates) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
// One metric decides the whole ordering. Comparing some pairs on bytes and
|
||||
// others on slots is intransitive -- with A,B reporting bytes and C not, the
|
||||
// order of A and C depends on which the sort happens to compare first -- so a
|
||||
// single node too old to report filesystem bytes puts every candidate on
|
||||
// slots rather than silently mixing the two.
|
||||
byBytes := true
|
||||
for _, c := range candidates {
|
||||
if !c.hasBytes {
|
||||
byBytes = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
sort.SliceStable(candidates, func(i, j int) bool {
|
||||
a, b := candidates[i], candidates[j]
|
||||
if a.locality != b.locality {
|
||||
return a.locality < b.locality
|
||||
}
|
||||
if byBytes && a.bytes != b.bytes {
|
||||
return a.bytes > b.bytes
|
||||
}
|
||||
return a.slots > b.slots
|
||||
})
|
||||
|
||||
chosen := candidates[0].node.info
|
||||
if d, ok := chosen.DiskInfos[string(pref.DiskType)]; ok && d != nil {
|
||||
d.VolumeCount++
|
||||
if d.DiskTotalBytes != 0 && d.DiskFreeBytes != 0 {
|
||||
// Spend the space this move actually takes, so the next pick from
|
||||
// this snapshot sees the node as fuller by the right amount. A big
|
||||
// volume charged the tier average would let a batch overcommit the
|
||||
// destination; a small one would divert later moves off a node that
|
||||
// still had room.
|
||||
spend := pref.VolumeBytes
|
||||
if spend == 0 {
|
||||
spend = d.DiskTotalBytes / uint64(max64(d.MaxVolumeCount, 1))
|
||||
}
|
||||
if d.DiskFreeBytes > spend {
|
||||
d.DiskFreeBytes -= spend
|
||||
} else {
|
||||
d.DiskFreeBytes = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
return chosen
|
||||
}
|
||||
|
||||
func max64(a, b int64) int64 {
|
||||
if a > b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// node is a volume server as a placement snapshot sees it: where it sits and
|
||||
// what it has free. Deliberately smaller than the balancer's Node, which also
|
||||
// carries the volumes it holds -- placement never needs those.
|
||||
type node struct {
|
||||
info *master_pb.DataNodeInfo
|
||||
dc string
|
||||
rack string
|
||||
}
|
||||
|
||||
func (n *node) disk(diskType types.DiskType) *master_pb.DiskInfo {
|
||||
d, found := n.info.DiskInfos[string(diskType)]
|
||||
if !found {
|
||||
return nil
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
||||
// candidateNodes flattens the topology, keeping one data center when anchored.
|
||||
func candidateNodes(topo *master_pb.TopologyInfo, anchorDataCenter string) (nodes []*node) {
|
||||
for _, dc := range topo.GetDataCenterInfos() {
|
||||
if anchorDataCenter != "" && dc.GetId() != anchorDataCenter {
|
||||
continue
|
||||
}
|
||||
for _, rack := range dc.GetRackInfos() {
|
||||
for _, dn := range rack.GetDataNodeInfos() {
|
||||
nodes = append(nodes, &node{info: dn, dc: dc.GetId(), rack: rack.GetId()})
|
||||
}
|
||||
}
|
||||
}
|
||||
return nodes
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
package placement
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/storage/types"
|
||||
)
|
||||
|
||||
func placementNode(id string, maxVolumes, used int64, totalBytes, freeBytes uint64) *master_pb.DataNodeInfo {
|
||||
return &master_pb.DataNodeInfo{Id: id, DiskInfos: map[string]*master_pb.DiskInfo{
|
||||
"ssd": {
|
||||
MaxVolumeCount: maxVolumes, VolumeCount: used,
|
||||
DiskTotalBytes: totalBytes, DiskFreeBytes: freeBytes,
|
||||
},
|
||||
}}
|
||||
}
|
||||
|
||||
// placementTopo builds a one-datacenter topology, taking each node's first
|
||||
// character as its rack so the tests read compactly.
|
||||
func placementTopo(nodes ...*master_pb.DataNodeInfo) *master_pb.TopologyInfo {
|
||||
byRack := map[string][]*master_pb.DataNodeInfo{}
|
||||
var order []string
|
||||
for _, n := range nodes {
|
||||
rack := n.Id[:1]
|
||||
if _, seen := byRack[rack]; !seen {
|
||||
order = append(order, rack)
|
||||
}
|
||||
byRack[rack] = append(byRack[rack], n)
|
||||
}
|
||||
var racks []*master_pb.RackInfo
|
||||
for _, r := range order {
|
||||
racks = append(racks, &master_pb.RackInfo{Id: r, DataNodeInfos: byRack[r]})
|
||||
}
|
||||
return &master_pb.TopologyInfo{DataCenterInfos: []*master_pb.DataCenterInfo{{Id: "dc1", RackInfos: racks}}}
|
||||
}
|
||||
|
||||
func TestPickTargetPrefersTheEmptiestByFreeBytes(t *testing.T) {
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 1, 1000, 200),
|
||||
placementNode("a2", 10, 1, 1000, 900),
|
||||
placementNode("a3", 10, 1, 1000, 500),
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType})
|
||||
if got.GetId() != "a2" {
|
||||
t.Fatalf("got %q, want the node with the most free bytes (a2)", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetFallsBackToSlotsWithoutReportedBytes(t *testing.T) {
|
||||
// A volume server too old to report filesystem bytes must still be ordered
|
||||
// sensibly rather than read as having zero free.
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 9, 0, 0),
|
||||
placementNode("a2", 10, 2, 0, 0),
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType})
|
||||
if got.GetId() != "a2" {
|
||||
t.Fatalf("got %q, want the node with the most free slots (a2)", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetSkipsSourceExcludedAndFull(t *testing.T) {
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 1, 1000, 900), // the source itself
|
||||
placementNode("a2", 10, 1, 1000, 800), // already spoken for by the plan
|
||||
placementNode("a3", 5, 5, 1000, 700), // no free slot
|
||||
placementNode("a4", 10, 1, 1000, 100),
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{
|
||||
Source: "a1", DiskType: types.SsdType, Exclude: map[string]bool{"a2": true},
|
||||
})
|
||||
if got.GetId() != "a4" {
|
||||
t.Fatalf("got %q, want a4", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetReturnsNilWhenNothingFits(t *testing.T) {
|
||||
topo := placementTopo(placementNode("a1", 5, 5, 1000, 900))
|
||||
if got := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType}); got != nil {
|
||||
t.Fatalf("got %q, want nil", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetHonoursAnchorDataCenter(t *testing.T) {
|
||||
topo := &master_pb.TopologyInfo{DataCenterInfos: []*master_pb.DataCenterInfo{
|
||||
{Id: "dc1", RackInfos: []*master_pb.RackInfo{{Id: "r1", DataNodeInfos: []*master_pb.DataNodeInfo{
|
||||
placementNode("a1", 10, 1, 1000, 100),
|
||||
}}}},
|
||||
{Id: "dc2", RackInfos: []*master_pb.RackInfo{{Id: "r2", DataNodeInfos: []*master_pb.DataNodeInfo{
|
||||
placementNode("b1", 10, 1, 1000, 900),
|
||||
}}}},
|
||||
}}
|
||||
got := PickTarget(topo, PlacementPreference{
|
||||
Source: "z9", DiskType: types.SsdType, AnchorDataCenter: "dc1",
|
||||
})
|
||||
if got.GetId() != "a1" {
|
||||
t.Fatalf("got %q, want a1 -- the anchor outranks an emptier node elsewhere", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetPrefersTheSourceRackOverAnEmptierStranger(t *testing.T) {
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 1, 1000, 500), // source, rack a
|
||||
placementNode("a2", 10, 1, 1000, 100), // same rack, tighter
|
||||
placementNode("b1", 10, 1, 1000, 900), // other rack, emptiest
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{Source: "a1", DiskType: types.SsdType})
|
||||
if got.GetId() != "a2" {
|
||||
t.Fatalf("got %q, want a2 -- same rack outranks emptier", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetLeavesTheRackWhenItCannotHoldTheVolume(t *testing.T) {
|
||||
// Locality is a preference over candidates, never a reason to overfill.
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 1, 1000, 500), // source
|
||||
placementNode("a2", 5, 5, 1000, 900), // same rack, no free slot
|
||||
placementNode("b1", 10, 1, 1000, 100),
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{Source: "a1", DiskType: types.SsdType})
|
||||
if got.GetId() != "b1" {
|
||||
t.Fatalf("got %q, want b1 -- a full same-rack node is not a candidate", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetPrefersSameDataCenterOverAnother(t *testing.T) {
|
||||
topo := &master_pb.TopologyInfo{DataCenterInfos: []*master_pb.DataCenterInfo{
|
||||
{Id: "dc1", RackInfos: []*master_pb.RackInfo{
|
||||
{Id: "r1", DataNodeInfos: []*master_pb.DataNodeInfo{placementNode("a1", 10, 1, 1000, 500)}},
|
||||
{Id: "r2", DataNodeInfos: []*master_pb.DataNodeInfo{placementNode("a2", 10, 1, 1000, 100)}},
|
||||
}},
|
||||
{Id: "dc2", RackInfos: []*master_pb.RackInfo{
|
||||
{Id: "r3", DataNodeInfos: []*master_pb.DataNodeInfo{placementNode("b1", 10, 1, 1000, 900)}},
|
||||
}},
|
||||
}}
|
||||
got := PickTarget(topo, PlacementPreference{Source: "a1", DiskType: types.SsdType})
|
||||
if got.GetId() != "a2" {
|
||||
t.Fatalf("got %q, want a2 -- another rack in the same dc beats another dc", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetFallsBackToCapacityForAnUnknownSource(t *testing.T) {
|
||||
// A source that is not in the topology has no rack to be near, so ordering
|
||||
// degrades to capacity rather than to topology order.
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 1, 1000, 100),
|
||||
placementNode("b1", 10, 1, 1000, 900),
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{Source: "gone:8080", DiskType: types.SsdType})
|
||||
if got.GetId() != "b1" {
|
||||
t.Fatalf("got %q, want b1", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetSpendsCapacitySoABatchSpreads(t *testing.T) {
|
||||
// The reservation this exists for: planning several moves from one snapshot
|
||||
// must not stack them all on whichever node started emptiest.
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 4, 0, 4000, 4000),
|
||||
placementNode("a2", 4, 0, 4000, 3000),
|
||||
)
|
||||
seen := map[string]int{}
|
||||
for i := 0; i < 4; i++ {
|
||||
got := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType})
|
||||
if got == nil {
|
||||
t.Fatalf("pick %d returned nil", i)
|
||||
}
|
||||
seen[got.GetId()]++
|
||||
}
|
||||
if seen["a1"] == 4 || seen["a2"] == 4 {
|
||||
t.Fatalf("all four picks landed on one node: %v", seen)
|
||||
}
|
||||
if seen["a1"]+seen["a2"] != 4 {
|
||||
t.Fatalf("unexpected spread: %v", seen)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetStopsWhenTheSnapshotIsSpent(t *testing.T) {
|
||||
// Reservation has to make a node stop being a candidate, not merely rank it
|
||||
// lower, or a batch could overcommit a tier.
|
||||
topo := placementTopo(placementNode("a1", 2, 0, 2000, 2000))
|
||||
for i := 0; i < 2; i++ {
|
||||
if got := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType}); got == nil {
|
||||
t.Fatalf("pick %d returned nil while slots remained", i)
|
||||
}
|
||||
}
|
||||
if got := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType}); got != nil {
|
||||
t.Fatalf("got %q, want nil once the snapshot is spent", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetUsesOneMetricWhenReportingIsMixed(t *testing.T) {
|
||||
// b1 has the most free bytes but the fewest slots; a2 the reverse. With a3
|
||||
// reporting no bytes at all, every candidate must be ordered on slots, or
|
||||
// the comparator is intransitive and the winner depends on sort order.
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 1, 1000, 500), // source
|
||||
placementNode("a2", 10, 1, 1000, 100),
|
||||
placementNode("a3", 10, 2, 0, 0), // too old to report bytes
|
||||
placementNode("a4", 10, 8, 1000, 900),
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{Source: "a1", DiskType: types.SsdType})
|
||||
if got.GetId() != "a2" {
|
||||
t.Fatalf("got %q, want a2 -- the most free slots once bytes are unusable", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetReservesTheVolumeSize(t *testing.T) {
|
||||
// A volume far bigger than the tier average must be charged at its real
|
||||
// size, or a batch of them overcommits the destination.
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 0, 1000, 1000),
|
||||
placementNode("a2", 10, 0, 1000, 900),
|
||||
)
|
||||
first := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType, VolumeBytes: 800})
|
||||
if first.GetId() != "a1" {
|
||||
t.Fatalf("first pick %q, want a1", first.GetId())
|
||||
}
|
||||
// a1 now reports 200 free against a2's 900, so the next move must go there
|
||||
// rather than to the node that merely started emptiest.
|
||||
second := PickTarget(topo, PlacementPreference{Source: "z9", DiskType: types.SsdType, VolumeBytes: 800})
|
||||
if second.GetId() != "a2" {
|
||||
t.Fatalf("second pick %q, want a2 after 800 bytes were spent on a1", second.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetHonoursTheCallerPredicate(t *testing.T) {
|
||||
// Constraints placement does not model -- replica placement, a node already
|
||||
// holding the volume -- stay with the caller, which keeps them out of the
|
||||
// ranking rather than duplicating them here.
|
||||
topo := placementTopo(
|
||||
placementNode("a1", 10, 1, 1000, 900),
|
||||
placementNode("a2", 10, 1, 1000, 500),
|
||||
)
|
||||
got := PickTarget(topo, PlacementPreference{
|
||||
Source: "z9", DiskType: types.SsdType,
|
||||
Accept: func(n *master_pb.DataNodeInfo, dc, rack string) bool { return n.Id != "a1" },
|
||||
})
|
||||
if got.GetId() != "a2" {
|
||||
t.Fatalf("got %q, want a2 -- a1 was rejected despite being emptier", got.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPickTargetPredicateSeesRackAndDataCenter(t *testing.T) {
|
||||
topo := placementTopo(placementNode("a1", 10, 1, 1000, 900))
|
||||
var sawDc, sawRack string
|
||||
PickTarget(topo, PlacementPreference{
|
||||
Source: "z9", DiskType: types.SsdType,
|
||||
Accept: func(n *master_pb.DataNodeInfo, dc, rack string) bool {
|
||||
sawDc, sawRack = dc, rack
|
||||
return true
|
||||
},
|
||||
})
|
||||
if sawDc != "dc1" || sawRack != "a" {
|
||||
t.Fatalf("predicate saw dc=%q rack=%q, want dc1/a", sawDc, sawRack)
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/service/s3"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/iam_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -125,3 +126,167 @@ func TestUnscopedIdentityReusesConfiguredAccount(t *testing.T) {
|
||||
assert.Equal(t, "Alice Smith", alice.Account.DisplayName,
|
||||
"identity must reuse the configured account, not the synthesized one")
|
||||
}
|
||||
|
||||
// Users created through the IAM API carry their account inline on the identity,
|
||||
// and no credential store emits a top-level accounts list. Such an account must
|
||||
// be registered rather than collapsed into the admin account, which gave every
|
||||
// one of those users the same owner id for ownership checks.
|
||||
func TestInlineIdentityAccountIsRegistered(t *testing.T) {
|
||||
resetMemoryStore()
|
||||
|
||||
config := `{
|
||||
"identities": [
|
||||
{"name": "alice", "account": {"id": "100000000001", "displayName": "Alice", "emailAddress": "alice@example.com"}, "credentials": [{"accessKey": "alice_ak", "secretKey": "alice_sk"}], "actions": ["Read", "Write"]},
|
||||
{"name": "bob", "account": {"id": "100000000002", "displayName": "Bob", "emailAddress": "bob@example.com"}, "credentials": [{"accessKey": "bob_ak", "secretKey": "bob_sk"}], "actions": ["Read", "Write"]}
|
||||
]
|
||||
}`
|
||||
tmp, err := os.CreateTemp("", "s3-config-*.json")
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(tmp.Name())
|
||||
_, err = tmp.WriteString(config)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, tmp.Close())
|
||||
|
||||
iam := NewIdentityAccessManagementWithStore(&S3ApiServerOption{Config: tmp.Name()}, nil, "memory")
|
||||
|
||||
alice, _, found := iam.LookupByAccessKey("alice_ak")
|
||||
require.True(t, found)
|
||||
require.NotNil(t, alice.Account)
|
||||
assert.Equal(t, "100000000001", alice.Account.Id, "an undeclared inline account must not collapse into admin")
|
||||
|
||||
bob, _, found := iam.LookupByAccessKey("bob_ak")
|
||||
require.True(t, found)
|
||||
require.NotNil(t, bob.Account)
|
||||
assert.NotEqual(t, alice.Account.Id, bob.Account.Id, "distinct users must not share an owner id")
|
||||
|
||||
assert.Equal(t, "Alice", iam.GetAccountNameById("100000000001"), "the registered account must resolve for ACL/owner display")
|
||||
assert.Equal(t, "100000000002", iam.GetAccountIdByEmail("bob@example.com"), "the registered account must resolve by email")
|
||||
}
|
||||
|
||||
// A dynamic update carries a single identity with no accounts list, so the merge
|
||||
// path must register the inline account the same way the full load does.
|
||||
func TestInlineIdentityAccountIsRegisteredOnUpsert(t *testing.T) {
|
||||
resetMemoryStore()
|
||||
|
||||
config := `{
|
||||
"identities": [
|
||||
{"name": "admin", "credentials": [{"accessKey": "admin_ak", "secretKey": "admin_sk"}], "actions": ["Admin"]}
|
||||
]
|
||||
}`
|
||||
tmp, err := os.CreateTemp("", "s3-config-*.json")
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(tmp.Name())
|
||||
_, err = tmp.WriteString(config)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, tmp.Close())
|
||||
|
||||
iam := NewIdentityAccessManagementWithStore(&S3ApiServerOption{Config: tmp.Name()}, nil, "memory")
|
||||
|
||||
require.NoError(t, iam.UpsertIdentity(&iam_pb.Identity{
|
||||
Name: "alice",
|
||||
Account: &iam_pb.Account{Id: "100000000001", DisplayName: "Alice", EmailAddress: "alice@example.com"},
|
||||
Credentials: []*iam_pb.Credential{{AccessKey: "alice_ak", SecretKey: "alice_sk"}},
|
||||
Actions: []string{"Read", "Write"},
|
||||
}))
|
||||
|
||||
alice, _, found := iam.LookupByAccessKey("alice_ak")
|
||||
require.True(t, found)
|
||||
require.NotNil(t, alice.Account)
|
||||
assert.Equal(t, "100000000001", alice.Account.Id, "a pushed identity must keep its own account id")
|
||||
assert.NotEqual(t, AccountAdmin.Id, alice.Account.Id, "a pushed identity must not inherit the admin account")
|
||||
assert.Equal(t, "Alice", iam.GetAccountNameById("100000000001"), "the registered account must resolve for ACL/owner display")
|
||||
|
||||
// Changing the email keeps the account id, so the merge starts from a cached
|
||||
// account that still carries the old address.
|
||||
require.NoError(t, iam.UpsertIdentity(&iam_pb.Identity{
|
||||
Name: "alice",
|
||||
Account: &iam_pb.Account{Id: "100000000001", DisplayName: "Alice Smith", EmailAddress: "alice.smith@example.com"},
|
||||
Credentials: []*iam_pb.Credential{{AccessKey: "alice_ak", SecretKey: "alice_sk"}},
|
||||
Actions: []string{"Read", "Write"},
|
||||
}))
|
||||
|
||||
assert.Equal(t, "100000000001", iam.GetAccountIdByEmail("alice.smith@example.com"), "the new email must be indexed")
|
||||
assert.Empty(t, iam.GetAccountIdByEmail("alice@example.com"), "the replaced email must no longer resolve")
|
||||
assert.Equal(t, "Alice Smith", iam.GetAccountNameById("100000000001"), "the display name must follow the update")
|
||||
}
|
||||
|
||||
// Two inline accounts can carry the same email. The first to register keeps the
|
||||
// lookup, and the loser can claim it once the holder moves away — otherwise an
|
||||
// email freed by an update would resolve to nobody.
|
||||
func TestInlineAccountEmailClaimAndHandoff(t *testing.T) {
|
||||
resetMemoryStore()
|
||||
|
||||
config := `{
|
||||
"identities": [
|
||||
{"name": "admin", "credentials": [{"accessKey": "admin_ak", "secretKey": "admin_sk"}], "actions": ["Admin"]}
|
||||
]
|
||||
}`
|
||||
tmp, err := os.CreateTemp("", "s3-config-*.json")
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(tmp.Name())
|
||||
_, err = tmp.WriteString(config)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, tmp.Close())
|
||||
|
||||
iam := NewIdentityAccessManagementWithStore(&S3ApiServerOption{Config: tmp.Name()}, nil, "memory")
|
||||
|
||||
require.NoError(t, iam.UpsertIdentity(&iam_pb.Identity{
|
||||
Name: "alice",
|
||||
Account: &iam_pb.Account{Id: "100000000001", DisplayName: "Alice", EmailAddress: "shared@example.com"},
|
||||
Credentials: []*iam_pb.Credential{{AccessKey: "alice_ak", SecretKey: "alice_sk"}},
|
||||
Actions: []string{"Read"},
|
||||
}))
|
||||
require.NoError(t, iam.UpsertIdentity(&iam_pb.Identity{
|
||||
Name: "bob",
|
||||
Account: &iam_pb.Account{Id: "100000000002", DisplayName: "Bob", EmailAddress: "shared@example.com"},
|
||||
Credentials: []*iam_pb.Credential{{AccessKey: "bob_ak", SecretKey: "bob_sk"}},
|
||||
Actions: []string{"Read"},
|
||||
}))
|
||||
|
||||
assert.Equal(t, "100000000001", iam.GetAccountIdByEmail("shared@example.com"), "the first account to claim an email keeps it")
|
||||
|
||||
// alice moves off the shared address, freeing it
|
||||
require.NoError(t, iam.UpsertIdentity(&iam_pb.Identity{
|
||||
Name: "alice",
|
||||
Account: &iam_pb.Account{Id: "100000000001", DisplayName: "Alice", EmailAddress: "alice@example.com"},
|
||||
Credentials: []*iam_pb.Credential{{AccessKey: "alice_ak", SecretKey: "alice_sk"}},
|
||||
Actions: []string{"Read"},
|
||||
}))
|
||||
assert.Equal(t, "100000000001", iam.GetAccountIdByEmail("alice@example.com"), "the moved account indexes its new email")
|
||||
|
||||
// bob re-syncs unchanged and picks up the address he never got to claim
|
||||
require.NoError(t, iam.UpsertIdentity(&iam_pb.Identity{
|
||||
Name: "bob",
|
||||
Account: &iam_pb.Account{Id: "100000000002", DisplayName: "Bob", EmailAddress: "shared@example.com"},
|
||||
Credentials: []*iam_pb.Credential{{AccessKey: "bob_ak", SecretKey: "bob_sk"}},
|
||||
Actions: []string{"Read"},
|
||||
}))
|
||||
assert.Equal(t, "100000000002", iam.GetAccountIdByEmail("shared@example.com"), "a freed email resolves to the account still holding it")
|
||||
}
|
||||
|
||||
// An account declared in a top-level accounts list outranks an identity's inline
|
||||
// block, which must not rewrite its metadata or take over its email.
|
||||
func TestDeclaredAccountOutranksInlineIdentityAccount(t *testing.T) {
|
||||
resetMemoryStore()
|
||||
|
||||
config := `{
|
||||
"accounts": [
|
||||
{"id": "100000000001", "displayName": "Alice Smith", "emailAddress": "alice@example.com"}
|
||||
],
|
||||
"identities": [
|
||||
{"name": "alice", "account": {"id": "100000000001", "displayName": "wrong", "emailAddress": "wrong@example.com"}, "credentials": [{"accessKey": "alice_ak", "secretKey": "alice_sk"}], "actions": ["Read"]}
|
||||
]
|
||||
}`
|
||||
tmp, err := os.CreateTemp("", "s3-config-*.json")
|
||||
require.NoError(t, err)
|
||||
defer os.Remove(tmp.Name())
|
||||
_, err = tmp.WriteString(config)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, tmp.Close())
|
||||
|
||||
iam := NewIdentityAccessManagementWithStore(&S3ApiServerOption{Config: tmp.Name()}, nil, "memory")
|
||||
|
||||
assert.Equal(t, "Alice Smith", iam.GetAccountNameById("100000000001"), "the declared display name must win")
|
||||
assert.Equal(t, "100000000001", iam.GetAccountIdByEmail("alice@example.com"), "the declared email must stay indexed")
|
||||
assert.Empty(t, iam.GetAccountIdByEmail("wrong@example.com"), "an inline block must not claim an email for a declared account")
|
||||
}
|
||||
@@ -125,6 +125,11 @@ type Account struct {
|
||||
|
||||
//Id is used to identify an Account when granting cross-account access(ACLs) to buckets and objects
|
||||
Id string
|
||||
|
||||
// declared marks an account from a top-level accounts list or a predefined
|
||||
// default. An account registered from an identity's inline block is not
|
||||
// declared, and the identity stays authoritative for its metadata.
|
||||
declared bool
|
||||
}
|
||||
|
||||
// Default account ID for all automated SeaweedFS accounts and fallback
|
||||
@@ -137,6 +142,7 @@ var (
|
||||
DisplayName: "admin",
|
||||
EmailAddress: "admin@example.com",
|
||||
Id: s3_constants.AccountAdminId,
|
||||
declared: true,
|
||||
}
|
||||
|
||||
// AccountAnonymous is used to represent the account for anonymous access
|
||||
@@ -144,6 +150,7 @@ var (
|
||||
DisplayName: "anonymous",
|
||||
EmailAddress: "anonymous@example.com",
|
||||
Id: s3_constants.AccountAnonymousId,
|
||||
declared: true,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -160,6 +167,70 @@ func accountForUnscopedIdentity(name string) *Account {
|
||||
}
|
||||
}
|
||||
|
||||
// indexAccountEmail points an email at its account unless a different account
|
||||
// already claims it, so an inline block cannot take over a declared account's
|
||||
// email.
|
||||
func indexAccountEmail(emailAccount map[string]*Account, account *Account) {
|
||||
if account.EmailAddress == "" {
|
||||
return
|
||||
}
|
||||
if claimed, taken := emailAccount[account.EmailAddress]; taken && claimed.Id != account.Id {
|
||||
return
|
||||
}
|
||||
emailAccount[account.EmailAddress] = account
|
||||
}
|
||||
|
||||
// resolveIdentityAccount returns the account an identity owns resources under,
|
||||
// registering it in accounts when it is not already known so the id resolves
|
||||
// through GetAccountNameById. Credential stores persist an account inline on the
|
||||
// identity and never emit a top-level accounts list, so an id missing from
|
||||
// accounts means undeclared, not invalid: falling back to the admin account
|
||||
// would give every such identity the same owner id.
|
||||
//
|
||||
// An undeclared account is only described by the identity carrying it, so its
|
||||
// metadata is refreshed from every load — the merge path starts from the live
|
||||
// cache, and a user whose email changed would otherwise keep the old one
|
||||
// indexed. A declared account outranks the inline block and is left alone.
|
||||
func resolveIdentityAccount(ident *iam_pb.Identity, accounts map[string]*Account, emailAccount map[string]*Account) *Account {
|
||||
if ident.Account == nil || ident.Account.Id == "" {
|
||||
synthesized := accountForUnscopedIdentity(ident.Name)
|
||||
if existing, ok := accounts[synthesized.Id]; ok {
|
||||
return existing
|
||||
}
|
||||
accounts[synthesized.Id] = synthesized
|
||||
return synthesized
|
||||
}
|
||||
|
||||
account := &Account{
|
||||
Id: ident.Account.Id,
|
||||
DisplayName: ident.Account.DisplayName,
|
||||
EmailAddress: ident.Account.EmailAddress,
|
||||
}
|
||||
|
||||
existing, ok := accounts[account.Id]
|
||||
if ok {
|
||||
if existing.declared {
|
||||
return existing
|
||||
}
|
||||
if existing.DisplayName == account.DisplayName && existing.EmailAddress == account.EmailAddress {
|
||||
// an email this account lost to another one is claimable once freed
|
||||
indexAccountEmail(emailAccount, existing)
|
||||
return existing
|
||||
}
|
||||
glog.V(3).Infof("refreshing account %s from identity %s", account.Id, ident.Name)
|
||||
// drop the email this account itself indexed; another account's claim stands
|
||||
if claimed, indexed := emailAccount[existing.EmailAddress]; indexed && claimed.Id == existing.Id {
|
||||
delete(emailAccount, existing.EmailAddress)
|
||||
}
|
||||
} else {
|
||||
glog.V(3).Infof("registering account %s from identity %s", account.Id, ident.Name)
|
||||
}
|
||||
|
||||
accounts[account.Id] = account
|
||||
indexAccountEmail(emailAccount, account)
|
||||
return account
|
||||
}
|
||||
|
||||
type Credential struct {
|
||||
AccessKey string
|
||||
SecretKey string
|
||||
@@ -639,6 +710,7 @@ func (iam *IdentityAccessManagement) ReplaceS3ApiConfiguration(config *iam_pb.S3
|
||||
Id: account.Id,
|
||||
DisplayName: account.DisplayName,
|
||||
EmailAddress: account.EmailAddress,
|
||||
declared: true,
|
||||
}
|
||||
switch account.Id {
|
||||
case AccountAdmin.Id:
|
||||
@@ -655,6 +727,7 @@ func (iam *IdentityAccessManagement) ReplaceS3ApiConfiguration(config *iam_pb.S3
|
||||
DisplayName: AccountAdmin.DisplayName,
|
||||
EmailAddress: AccountAdmin.EmailAddress,
|
||||
Id: AccountAdmin.Id,
|
||||
declared: true,
|
||||
}
|
||||
emailAccount[AccountAdmin.EmailAddress] = accounts[AccountAdmin.Id]
|
||||
}
|
||||
@@ -663,6 +736,7 @@ func (iam *IdentityAccessManagement) ReplaceS3ApiConfiguration(config *iam_pb.S3
|
||||
DisplayName: AccountAnonymous.DisplayName,
|
||||
EmailAddress: AccountAnonymous.EmailAddress,
|
||||
Id: AccountAnonymous.Id,
|
||||
declared: true,
|
||||
}
|
||||
emailAccount[AccountAnonymous.EmailAddress] = accounts[AccountAnonymous.Id]
|
||||
}
|
||||
@@ -689,30 +763,11 @@ func (iam *IdentityAccessManagement) ReplaceS3ApiConfiguration(config *iam_pb.S3
|
||||
Disabled: ident.Disabled, // false (default) = enabled, true = disabled
|
||||
PolicyNames: ident.PolicyNames,
|
||||
}
|
||||
switch {
|
||||
case ident.Name == AccountAnonymous.Id:
|
||||
if ident.Name == AccountAnonymous.Id {
|
||||
t.Account = &AccountAnonymous
|
||||
identityAnonymous = t
|
||||
case ident.Account == nil:
|
||||
// Account-less identities own resources under a distinct id derived
|
||||
// from their name. Reuse an explicitly-configured account with that
|
||||
// id if one exists (preserving its display name/email); otherwise
|
||||
// synthesize one and register it so the id resolves via
|
||||
// GetAccountNameById (ACL grantee validation, owner display).
|
||||
synthesized := accountForUnscopedIdentity(t.Name)
|
||||
if existing, ok := accounts[synthesized.Id]; ok {
|
||||
t.Account = existing
|
||||
} else {
|
||||
t.Account = synthesized
|
||||
accounts[synthesized.Id] = synthesized
|
||||
}
|
||||
default:
|
||||
if account, ok := accounts[ident.Account.Id]; ok {
|
||||
t.Account = account
|
||||
} else {
|
||||
t.Account = &AccountAdmin
|
||||
glog.Warningf("identity %s is associated with a non exist account ID, the association is invalid", ident.Name)
|
||||
}
|
||||
} else {
|
||||
t.Account = resolveIdentityAccount(ident, accounts, emailAccount)
|
||||
}
|
||||
|
||||
for _, action := range ident.Actions {
|
||||
@@ -881,6 +936,7 @@ func (iam *IdentityAccessManagement) MergeS3ApiConfiguration(config *iam_pb.S3Ap
|
||||
Id: account.Id,
|
||||
DisplayName: account.DisplayName,
|
||||
EmailAddress: account.EmailAddress,
|
||||
declared: true,
|
||||
}
|
||||
if account.EmailAddress != "" {
|
||||
emailAccount[account.EmailAddress] = accounts[account.Id]
|
||||
@@ -894,6 +950,7 @@ func (iam *IdentityAccessManagement) MergeS3ApiConfiguration(config *iam_pb.S3Ap
|
||||
DisplayName: AccountAdmin.DisplayName,
|
||||
EmailAddress: AccountAdmin.EmailAddress,
|
||||
Id: AccountAdmin.Id,
|
||||
declared: true,
|
||||
}
|
||||
emailAccount[AccountAdmin.EmailAddress] = accounts[AccountAdmin.Id]
|
||||
}
|
||||
@@ -902,6 +959,7 @@ func (iam *IdentityAccessManagement) MergeS3ApiConfiguration(config *iam_pb.S3Ap
|
||||
DisplayName: AccountAnonymous.DisplayName,
|
||||
EmailAddress: AccountAnonymous.EmailAddress,
|
||||
Id: AccountAnonymous.Id,
|
||||
declared: true,
|
||||
}
|
||||
emailAccount[AccountAnonymous.EmailAddress] = accounts[AccountAnonymous.Id]
|
||||
}
|
||||
@@ -926,30 +984,11 @@ func (iam *IdentityAccessManagement) MergeS3ApiConfiguration(config *iam_pb.S3Ap
|
||||
IsStatic: fromStaticFile,
|
||||
}
|
||||
|
||||
switch {
|
||||
case ident.Name == AccountAnonymous.Id:
|
||||
if ident.Name == AccountAnonymous.Id {
|
||||
t.Account = &AccountAnonymous
|
||||
identityAnonymous = t
|
||||
case ident.Account == nil:
|
||||
// Account-less identities own resources under a distinct id derived
|
||||
// from their name. Reuse an explicitly-configured account with that
|
||||
// id if one exists (preserving its display name/email); otherwise
|
||||
// synthesize one and register it so the id resolves via
|
||||
// GetAccountNameById (ACL grantee validation, owner display).
|
||||
synthesized := accountForUnscopedIdentity(t.Name)
|
||||
if existing, ok := accounts[synthesized.Id]; ok {
|
||||
t.Account = existing
|
||||
} else {
|
||||
t.Account = synthesized
|
||||
accounts[synthesized.Id] = synthesized
|
||||
}
|
||||
default:
|
||||
if account, ok := accounts[ident.Account.Id]; ok {
|
||||
t.Account = account
|
||||
} else {
|
||||
t.Account = &AccountAdmin
|
||||
glog.Warningf("identity %s is associated with a non exist account ID, the association is invalid", ident.Name)
|
||||
}
|
||||
} else {
|
||||
t.Account = resolveIdentityAccount(ident, accounts, emailAccount)
|
||||
}
|
||||
|
||||
for _, action := range ident.Actions {
|
||||
@@ -1404,6 +1443,16 @@ func (iam *IdentityAccessManagement) GetAccountNameById(canonicalId string) stri
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetAccountIdByIdentityName resolves an identity name to the account its
|
||||
// resources are owned under. Bucket owners recorded outside the S3 API (the
|
||||
// admin UI, weed shell) name an identity, not an account.
|
||||
func (iam *IdentityAccessManagement) GetAccountIdByIdentityName(name string) string {
|
||||
if identity := iam.lookupByIdentityName(name); identity != nil && identity.Account != nil {
|
||||
return identity.Account.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (iam *IdentityAccessManagement) GetAccountIdByEmail(email string) string {
|
||||
iam.m.RLock()
|
||||
defer iam.m.RUnlock()
|
||||
|
||||
@@ -77,6 +77,22 @@ func (r *BucketRegistry) LoadBucketMetadata(entry *filer_pb.Entry) {
|
||||
r.unMarkNotFound(entry.Name)
|
||||
}
|
||||
|
||||
// bucketOwnerAccountId returns the account id owning the bucket entry. A bucket
|
||||
// created outside the S3 API (the admin UI, weed shell) records only its owning
|
||||
// identity, so that identity is resolved to its account. Without this such a
|
||||
// bucket looks unowned: it reports the default admin account as its ACL owner,
|
||||
// and under BucketOwnerEnforced every object written to it is stamped with that
|
||||
// account instead of the bucket owner.
|
||||
func bucketOwnerAccountId(accountManager AccountManager, entry *filer_pb.Entry) string {
|
||||
if ownerAccountId := string(entry.Extended[s3_constants.ExtAmzOwnerKey]); ownerAccountId != "" {
|
||||
return ownerAccountId
|
||||
}
|
||||
if identityName := string(entry.Extended[s3_constants.AmzIdentityId]); identityName != "" {
|
||||
return accountManager.GetAccountIdByIdentityName(identityName)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func buildBucketMetadata(accountManager AccountManager, entry *filer_pb.Entry) *BucketMetaData {
|
||||
entryJson, _ := json.Marshal(entry)
|
||||
glog.V(3).Infof("build bucket metadata,entry=%s", entryJson)
|
||||
@@ -85,7 +101,7 @@ func buildBucketMetadata(accountManager AccountManager, entry *filer_pb.Entry) *
|
||||
IsTableBucket: s3tables.IsTableBucketEntry(entry),
|
||||
|
||||
//Default ownership: OwnershipBucketOwnerEnforced, which means Acl is disabled
|
||||
ObjectOwnership: s3_constants.OwnershipBucketOwnerEnforced,
|
||||
ObjectOwnership: s3_constants.DefaultOwnershipForExists,
|
||||
|
||||
// Default owner: `AccountAdmin`
|
||||
Owner: &s3.Owner{
|
||||
@@ -95,22 +111,17 @@ func buildBucketMetadata(accountManager AccountManager, entry *filer_pb.Entry) *
|
||||
}
|
||||
if entry.Extended != nil {
|
||||
//ownership control
|
||||
ownership, ok := entry.Extended[s3_constants.ExtOwnershipKey]
|
||||
if ok {
|
||||
ownership := string(ownership)
|
||||
valid := s3_constants.ValidateOwnership(ownership)
|
||||
if valid {
|
||||
bucketMetadata.ObjectOwnership = ownership
|
||||
} else {
|
||||
glog.Warningf("Invalid ownership: %s, bucket: %s", ownership, bucketMetadata.Name)
|
||||
if ownership, ok := entry.Extended[s3_constants.ExtOwnershipKey]; ok {
|
||||
if !s3_constants.ValidateOwnership(string(ownership)) {
|
||||
glog.Warningf("Invalid ownership: %s, bucket: %s", string(ownership), bucketMetadata.Name)
|
||||
}
|
||||
bucketMetadata.ObjectOwnership = s3_constants.EffectiveOwnership(string(ownership))
|
||||
}
|
||||
|
||||
//access control policy
|
||||
//owner
|
||||
acpOwnerBytes, ok := entry.Extended[s3_constants.ExtAmzOwnerKey]
|
||||
if ok && len(acpOwnerBytes) > 0 {
|
||||
ownerAccountId := string(acpOwnerBytes)
|
||||
ownerAccountId := bucketOwnerAccountId(accountManager, entry)
|
||||
if ownerAccountId != "" {
|
||||
ownerAccountName := accountManager.GetAccountNameById(ownerAccountId)
|
||||
if ownerAccountName == "" {
|
||||
glog.Warningf("owner[id=%s] is invalid, bucket: %s", ownerAccountId, bucketMetadata.Name)
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package s3api
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/iam_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// ownerIdentityIAM loads an account-less identity and one scoped to an explicit
|
||||
// account, the two shapes a bucket owner name can resolve through.
|
||||
func ownerIdentityIAM(t *testing.T) *IdentityAccessManagement {
|
||||
t.Helper()
|
||||
iam := &IdentityAccessManagement{}
|
||||
require.NoError(t, iam.loadS3ApiConfiguration(&iam_pb.S3ApiConfiguration{
|
||||
Identities: []*iam_pb.Identity{
|
||||
{Name: "test", Actions: []string{"Read", "Write"}},
|
||||
{
|
||||
Name: "scoped",
|
||||
Actions: []string{"Read", "Write"},
|
||||
Account: &iam_pb.Account{Id: "100000000001", DisplayName: "Scoped"},
|
||||
},
|
||||
},
|
||||
}))
|
||||
return iam
|
||||
}
|
||||
|
||||
// A bucket created outside the S3 API — the admin UI or weed shell, which record
|
||||
// the owner as an identity and never write the account id the S3 API stores — is
|
||||
// owned by that identity, not by the default admin account. Getting this wrong
|
||||
// stamps every object uploaded to the bucket with the admin account, since the
|
||||
// default BucketOwnerEnforced ownership hands objects to the bucket owner.
|
||||
func TestBucketOwnerFromIdentityId(t *testing.T) {
|
||||
iam := ownerIdentityIAM(t)
|
||||
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
identityId string
|
||||
expectOwnerId string
|
||||
}{
|
||||
{"account-less identity", "test", "test"},
|
||||
{"identity scoped to an account", "scoped", "100000000001"},
|
||||
{"unknown identity", "ghost", AccountAdmin.Id},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
entry := &filer_pb.Entry{
|
||||
Name: "bucket",
|
||||
Extended: map[string][]byte{s3_constants.AmzIdentityId: []byte(tc.identityId)},
|
||||
}
|
||||
|
||||
metadata := buildBucketMetadata(iam, entry)
|
||||
require.NotNil(t, metadata.Owner)
|
||||
assert.Equal(t, tc.expectOwnerId, *metadata.Owner.ID)
|
||||
|
||||
s3a := &S3ApiServer{iam: iam}
|
||||
config := s3a.newBucketConfigFromEntry("bucket", entry)
|
||||
assert.Equal(t, tc.identityId, config.IdentityId)
|
||||
if tc.expectOwnerId != AccountAdmin.Id {
|
||||
assert.Equal(t, tc.expectOwnerId, config.Owner,
|
||||
"the bucket config owner must match the metadata owner")
|
||||
} else {
|
||||
assert.Empty(t, config.Owner, "an unresolvable owner leaves the config unowned")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// The account id recorded by the S3 API stays authoritative when both are present.
|
||||
func TestBucketOwnerPrefersAccountId(t *testing.T) {
|
||||
iam := ownerIdentityIAM(t)
|
||||
|
||||
entry := &filer_pb.Entry{
|
||||
Name: "bucket",
|
||||
Extended: map[string][]byte{
|
||||
s3_constants.AmzIdentityId: []byte("scoped"),
|
||||
s3_constants.ExtAmzOwnerKey: []byte("test"),
|
||||
},
|
||||
}
|
||||
|
||||
metadata := buildBucketMetadata(iam, entry)
|
||||
require.NotNil(t, metadata.Owner)
|
||||
assert.Equal(t, "test", *metadata.Owner.ID)
|
||||
}
|
||||
@@ -649,9 +649,10 @@ func (s3a *S3ApiServer) completeMultipartUpload(r *http.Request, input *s3.Compl
|
||||
glog.Errorf("completeMultipartUpload: failed to get versioning state for bucket %s: %v", *input.Bucket, vErr)
|
||||
return s3err.ErrInternalError
|
||||
}
|
||||
// Full object key, not just entryName, so the right .versions directory is used.
|
||||
normalizedKey := s3_constants.NormalizeObjectKey(*input.Key)
|
||||
|
||||
if versioningState == s3_constants.VersioningEnabled {
|
||||
// Use full object key (not just entryName) to ensure correct .versions directory is checked
|
||||
normalizedKey := strings.TrimPrefix(*input.Key, "/")
|
||||
useInvertedFormat := s3a.getVersionIdFormat(*input.Bucket, normalizedKey)
|
||||
versionId := generateVersionId(useInvertedFormat)
|
||||
versionFileName := s3a.getVersionFileName(versionId)
|
||||
@@ -823,6 +824,14 @@ func (s3a *S3ApiServer) completeMultipartUpload(r *http.Request, input *s3.Compl
|
||||
return s3err.ErrInternalError
|
||||
}
|
||||
|
||||
// A failed finalize leaves the key reading as deleted, so fail rather than
|
||||
// return 200 — a non-ErrNone finalize keeps the upload directory, so the
|
||||
// caller's retry replays.
|
||||
if err := s3a.finalizeSuspendedNullWrite(owner, *input.Bucket, normalizedKey, s3_constants.SeaweedFSUploadId, *input.UploadId); err != nil {
|
||||
glog.Errorf("completeMultipartUpload: failed to retire the null delete marker for %s/%s: %v", *input.Bucket, normalizedKey, err)
|
||||
return s3err.ErrInternalError
|
||||
}
|
||||
|
||||
// Note: Suspended versioning should NOT return VersionId field according to AWS S3 spec
|
||||
output = &CompleteMultipartUploadResult{
|
||||
Location: aws.String(fmt.Sprintf("%s://%s/%s/%s", getRequestScheme(r), r.Host, url.PathEscape(*input.Bucket), urlPathEscape(*input.Key))),
|
||||
|
||||
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user