snapshot of https://github.com/seaweedfs/seaweedfs.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
go: build dev binaries / cleanup (push) Successful in 4s
Codespell / Check for spelling errors (push) Failing after 3s
docker: build dev containers / build-rust-binaries (amd64, x86_64-unknown-linux-musl) (push) Failing after 3s
docker: build dev containers / build-dev-containers (push) Has been skipped
docker: build dev containers / build-rust-binaries (arm64, true, aarch64-unknown-linux-musl) (push) Failing after 3s
End to End / FUSE Mount (push) Failing after 2s
EC Integration Tests / EC Integration Tests (push) Failing after 30s
FUSE DLM Integration Tests / FUSE DLM Integration Tests (push) Failing after 3s
FUSE Volume Server Failover Tests / FUSE Volume Server Failover (push) Failing after 3s
FUSE Integration Tests / FUSE Integration Testing (push) Failing after 2s
FUSE P2P Peer Chunk Sharing Integration Tests / FUSE P2P Peer Chunk Sharing (push) Failing after 3s
go: build binary / Go Vet (push) Failing after 2s
go: build binary / Go Vet 32-bit (push) Failing after 3s
go: build binary / Build (push) Failing after 4s
go: build binary / Build cross-platform (freebsd/amd64) (push) Failing after 3s
go: build binary / Build cross-platform (windows/amd64) (push) Failing after 3s
go: build binary / Build cross-platform (darwin/arm64) (push) Failing after 3s
go: build binary / Build cross-platform (windows/arm64) (push) Failing after 3s
go: build binary / Test (push) Failing after 2s
go: build binary / Test 32-bit (push) Failing after 3s
helm: lint and test charts / lint-test (push) Failing after 3s
Java Client Integration Tests / Java Integration Tests (11) (push) Failing after 3s
Java Client Integration Tests / Java Integration Tests (17) (push) Failing after 3s
go: build dev binaries / build_dev_linux_windows (amd64, linux) (push) Failing after 2s
go: build dev binaries / build_dev_linux_windows (amd64, windows) (push) Failing after 3s
go: build dev binaries / build_dev_darwin (amd64, darwin) (push) Has been skipped
go: build dev binaries / build_dev_darwin (arm64, darwin) (push) Has been skipped
Java Client Unit Tests / Java Unit Tests (11) (push) Failing after 3s
Java Client Unit Tests / Java Unit Tests (17) (push) Failing after 2s
Java Client Unit Tests / Java Unit Tests (21) (push) Failing after 3s
Java Client Unit Tests / Java Unit Tests (8) (push) Failing after 3s
Kafka Quick Test (Load Test with Schema Registry) / Kafka Client Load Test (Quick) (push) Failing after 3s
Kafka Gateway Tests / Kafka Unit Tests (unit-tests-1) (push) Failing after 11s
Kafka Gateway Tests / Kafka Integration Tests (Critical) (integration-1) (push) Failing after 3s
Kafka Gateway Tests / Kafka End-to-End Tests (with SMQ) (e2e-1) (push) Failing after 3s
Kafka Gateway Tests / Kafka Consumer Group Tests (Highly Isolated) (consumer-group-1) (push) Failing after 2s
Kafka Gateway Tests / Kafka Client Compatibility (with SMQ) (client-compat-1) (push) Failing after 3s
Kafka Gateway Tests / Kafka SMQ Integration Tests (Full Stack) (smq-integration-1) (push) Failing after 3s
Kafka Gateway Tests / Kafka Protocol Tests (Isolated) (protocol-1) (push) Failing after 3s
KMS Tests / KMS Provider Integration Tests (push) Failing after 2s
KMS Tests / S3 KMS End-to-End Tests (push) Failing after 3s
Master Cold Start Tests / Master Cold Start Tests (push) Failing after 4s
Metadata Subscribe Integration Tests / Metadata Subscribe Integration Tests (push) Failing after 3s
Multi-Master Tests / Multi-Master Failover Tests (push) Failing after 3s
Performance / CPU and Heap Profile (push) Failing after 2s
Performance / S3 Read/Write Benchmark (rust volume) (push) Failing after 3s
pjdfstest POSIX Compliance / pjdfstest (push) Failing after 2s
Plugin Worker Integration Tests / Plugin Worker: erasure_coding (push) Failing after 3s
Plugin Worker Integration Tests / Plugin Worker: vacuum (push) Failing after 3s
Rust Volume Server Tests / Rust Integration Tests (push) Failing after 3s
Rust Volume Server Tests / Go Tests with Rust Volume (grpc - Shard 1) (push) Failing after 2s
Rust Volume Server Tests / Go Tests with Rust Volume (http - Shard 1) (push) Failing after 3s
Rust Volume Server Tests / Go Tests with Rust Volume (grpc - Shard 2) (push) Failing after 3s
Rust Volume Server Tests / Go Tests with Rust Volume (http - Shard 2) (push) Failing after 3s
Rust Volume Server Tests / Go Tests with Rust Volume (grpc - Shard 3) (push) Failing after 3s
S3 IAM Integration Tests / S3 IAM Distributed Tests (push) Failing after 2s
S3 IAM Integration Tests / S3 IAM Performance Tests (push) Failing after 3s
Performance / Throughput Benchmark (go volume) (push) Failing after 3s
Performance / Throughput Benchmark (rust volume) (push) Failing after 2s
Performance / S3 Read/Write Benchmark (go volume) (push) Failing after 3s
Plugin Worker Integration Tests / Plugin Worker: volume_balance (push) Failing after 3s
PostgreSQL Gateway Tests / PostgreSQL Basic Tests (push) Failing after 3s
Rust Volume Server Tests / Rust Unit Tests (push) Failing after 2s
Rust Volume Server Tests / Go Tests with Rust Volume (http - Shard 3) (push) Failing after 3s
Rust Plugin Worker Tests / Rust Plugin Worker Build and Unit Tests (push) Failing after 3s
rust: build dev volume server binaries / cleanup (push) Successful in 3s
S3 ETag and ACL Tests / S3 ETag + ACL Integration Tests (push) Failing after 3s
S3 IAM Integration Tests / IAM Unit Tests (push) Failing after 3s
S3 IAM Integration Tests / S3 IAM Integration Tests (advanced) (push) Failing after 3s
S3 IAM Integration Tests / S3 IAM Integration Tests (basic) (push) Failing after 2s
S3 IAM Integration Tests / S3 IAM Integration Tests (group) (push) Failing after 3s
S3 IAM Integration Tests / S3 IAM Integration Tests (policy-enforcement) (push) Failing after 2s
S3 IAM Integration Tests / S3 IAM Integration Tests (sts) (push) Failing after 4s
S3 Keycloak Integration Tests / S3 Keycloak Integration Tests (push) Failing after 3s
S3 PyArrow Parquet Tests / PyArrow Parquet Tests (Python 3.11) (push) Failing after 3s
S3 PyArrow Parquet Tests / Go Unit Tests (Implicit Directory) (push) Has been cancelled
S3 PyArrow Parquet Tests / PyArrow Parquet Tests (Python 3.12) (push) Has been cancelled
rust: build dev volume server binaries / build-rust-volume-dev-darwin (darwin-amd64, x86_64-apple-darwin) (push) Has been cancelled
rust: build dev volume server binaries / build-rust-volume-dev-darwin (darwin-arm64, aarch64-apple-darwin) (push) Has been cancelled
rust: build dev volume server binaries / build-rust-volume-dev-linux (linux-amd64, x86_64-unknown-linux-gnu) (push) Has been cancelled
S3 PyArrow Parquet Tests / PyArrow Parquet Tests (Python 3.9) (push) Has been cancelled
S3 Proxy Signature Tests / S3 Proxy Signature Verification Tests (push) Has been cancelled
S3 SDK V2 Route Disambiguation Tests / S3 SDK V2 Routing Tests (push) Has been cancelled
S3 SSE Tests / S3 SSE Integration Tests (quick) (push) Has been cancelled
S3 SSE Tests / S3 SSE Compatibility Test (push) Has been cancelled
S3 SSE Tests / S3 SSE Metadata Persistence Test (push) Has been cancelled
S3 SSE Tests / S3 SSE Copy Operations Test (push) Has been cancelled
S3 SSE Tests / S3 SSE Multipart Upload Test (push) Has been cancelled
S3 SSE Tests / S3 SSE Performance Test (push) Has been cancelled
S3 SSE Tests / S3 Volume Encryption Test (push) Has been cancelled
S3 SSE Tests / S3 SSE Integration Tests (comprehensive) (push) Has been cancelled
Spark Integration Tests / Spark Integration Tests (push) Failing after 2s
Telemetry Integration Tests / telemetry-integration-test (push) Failing after 3s
Volume Server Integration Tests / Volume Server Integration Tests (grpc - Shard 1) (push) Failing after 3s
Volume Server Integration Tests / Volume Server Integration Tests (http - Shard 1) (push) Failing after 3s
Ceph S3 tests / Basic S3 tests (KV store) (push) Has been cancelled
Ceph S3 tests / S3 Versioning & Object Lock tests (push) Has been cancelled
S3 Policy Integration Tests / S3 Policy Unit Tests (push) Failing after 3s
Ceph S3 tests / S3 CORS tests (push) Has been cancelled
Ceph S3 tests / SeaweedFS Custom S3 Copy tests (push) Has been cancelled
Ceph S3 tests / Basic S3 tests (SQL store) (push) Has been cancelled
test s3 over https using aws-cli / awscli-tests (push) Has been cancelled
TLS Rotation Integration Tests / TLS Rotation Integration Tests (push) Has been cancelled
Vacuum Integration Tests / Vacuum Integration Tests (push) Has been cancelled
S3 Policy Integration Tests / S3 Policy Variables Integration Tests (push) Failing after 3s
S3 Policy Integration Tests / S3 Policy Enforcement Integration Tests (advanced-policy) (push) Failing after 3s
S3 Policy Integration Tests / S3 Policy Enforcement Integration Tests (basic-policy) (push) Failing after 2s
S3 Policy Integration Tests / S3 Policy Enforcement Integration Tests (contextual-policy) (push) Failing after 4s
S3 Policy Integration Tests / Trusted Proxy Detection Tests (push) Failing after 2s
S3 Policy Integration Tests / S3 Policy Shell Integration Tests (push) Failing after 3s
Samba on FUSE Integration / samba-integration (push) Failing after 2s
SFTP Integration Tests / SFTP Integration Testing (push) Failing after 3s
terraform: validate and test modules / fmt, validate, plan-level tests (push) Failing after 3s
terraform: validate and test modules / local cluster smoke test (real weed) (push) Failing after 2s
Volume Server Integration Tests / Volume Server Integration Tests (grpc - Shard 3) (push) Failing after 3s
Volume Server Integration Tests / Volume Server Integration Tests (grpc - Shard 2) (push) Failing after 3s
Volume Server Integration Tests / Volume Server Integration Tests (http - Shard 2) (push) Failing after 2s
Volume Server Integration Tests / Volume Server Integration Tests (http - Shard 3) (push) Failing after 5s
mount: windows conformance / WinFsp conformance (push) Has been cancelled
mount: windows / Mount on Windows (push) Has been cancelled

This commit is contained in:
upstream-mirror
2026-09-16 03:23:42 +05:00
commit 89f5be005d
3997 changed files with 961970 additions and 0 deletions

View File

@@ -0,0 +1,281 @@
package tracker
import (
"encoding/json"
"fmt"
"os"
"sort"
"strings"
"sync"
"time"
)
// Record represents a tracked message
type Record struct {
Key string `json:"key"`
Topic string `json:"topic"`
Partition int32 `json:"partition"`
Offset int64 `json:"offset"`
Timestamp int64 `json:"timestamp"`
ProducerID int `json:"producer_id,omitempty"`
ConsumerID int `json:"consumer_id,omitempty"`
}
// Tracker tracks produced and consumed records
type Tracker struct {
mu sync.Mutex
producedRecords []Record
consumedRecords []Record
producedFile string
consumedFile string
testStartTime int64 // Unix timestamp in nanoseconds - used to filter old messages
testRunPrefix string // Key prefix for this test run (e.g., "run-20251015-170150")
filteredOldCount int // Count of old messages consumed but not tracked
}
// NewTracker creates a new record tracker
func NewTracker(producedFile, consumedFile string, testStartTime int64) *Tracker {
// Generate test run prefix from start time using same format as producer
// Producer format: p.startTime.Format("20060102-150405") -> "20251015-170859"
startTime := time.Unix(0, testStartTime)
runID := startTime.Format("20060102-150405")
testRunPrefix := fmt.Sprintf("run-%s", runID)
fmt.Printf("Tracker initialized with prefix: %s (filtering messages not matching this prefix)\n", testRunPrefix)
return &Tracker{
producedRecords: make([]Record, 0, 100000),
consumedRecords: make([]Record, 0, 100000),
producedFile: producedFile,
consumedFile: consumedFile,
testStartTime: testStartTime,
testRunPrefix: testRunPrefix,
filteredOldCount: 0,
}
}
// TrackProduced records a produced message
func (t *Tracker) TrackProduced(record Record) {
t.mu.Lock()
defer t.mu.Unlock()
t.producedRecords = append(t.producedRecords, record)
}
// TrackConsumed records a consumed message
// Only tracks messages from the current test run (filters out old messages from previous tests)
func (t *Tracker) TrackConsumed(record Record) {
t.mu.Lock()
defer t.mu.Unlock()
// Filter: Only track messages from current test run based on key prefix
// Producer keys look like: "run-20251015-170150-key-123"
// We only want messages that match our test run prefix
if !strings.HasPrefix(record.Key, t.testRunPrefix) {
// Count old messages consumed but not tracked
t.filteredOldCount++
return
}
t.consumedRecords = append(t.consumedRecords, record)
}
// SaveProduced writes produced records to file
func (t *Tracker) SaveProduced() error {
t.mu.Lock()
defer t.mu.Unlock()
f, err := os.Create(t.producedFile)
if err != nil {
return fmt.Errorf("failed to create produced file: %v", err)
}
defer f.Close()
encoder := json.NewEncoder(f)
for _, record := range t.producedRecords {
if err := encoder.Encode(record); err != nil {
return fmt.Errorf("failed to encode produced record: %v", err)
}
}
fmt.Printf("Saved %d produced records to %s\n", len(t.producedRecords), t.producedFile)
return nil
}
// SaveConsumed writes consumed records to file
func (t *Tracker) SaveConsumed() error {
t.mu.Lock()
defer t.mu.Unlock()
f, err := os.Create(t.consumedFile)
if err != nil {
return fmt.Errorf("failed to create consumed file: %v", err)
}
defer f.Close()
encoder := json.NewEncoder(f)
for _, record := range t.consumedRecords {
if err := encoder.Encode(record); err != nil {
return fmt.Errorf("failed to encode consumed record: %v", err)
}
}
fmt.Printf("Saved %d consumed records to %s\n", len(t.consumedRecords), t.consumedFile)
return nil
}
// Compare compares produced and consumed records
func (t *Tracker) Compare() ComparisonResult {
t.mu.Lock()
defer t.mu.Unlock()
result := ComparisonResult{
TotalProduced: len(t.producedRecords),
TotalConsumed: len(t.consumedRecords),
FilteredOldCount: t.filteredOldCount,
}
// Build maps for efficient lookup
producedMap := make(map[string]Record)
for _, record := range t.producedRecords {
key := fmt.Sprintf("%s-%d-%d", record.Topic, record.Partition, record.Offset)
producedMap[key] = record
}
consumedMap := make(map[string]int)
duplicateKeys := make(map[string][]Record)
for _, record := range t.consumedRecords {
key := fmt.Sprintf("%s-%d-%d", record.Topic, record.Partition, record.Offset)
consumedMap[key]++
if consumedMap[key] > 1 {
duplicateKeys[key] = append(duplicateKeys[key], record)
}
}
// Find missing records (produced but not consumed)
for key, record := range producedMap {
if _, found := consumedMap[key]; !found {
result.Missing = append(result.Missing, record)
}
}
// Find duplicate records (consumed multiple times)
for key, records := range duplicateKeys {
if len(records) > 0 {
// Add first occurrence for context
result.Duplicates = append(result.Duplicates, DuplicateRecord{
Record: records[0],
Count: consumedMap[key],
})
}
}
result.MissingCount = len(result.Missing)
result.DuplicateCount = len(result.Duplicates)
result.UniqueConsumed = result.TotalConsumed - sumDuplicates(result.Duplicates)
return result
}
// ComparisonResult holds the comparison results
type ComparisonResult struct {
TotalProduced int
TotalConsumed int
UniqueConsumed int
MissingCount int
DuplicateCount int
FilteredOldCount int // Old messages consumed but filtered out
Missing []Record
Duplicates []DuplicateRecord
}
// DuplicateRecord represents a record consumed multiple times
type DuplicateRecord struct {
Record Record
Count int
}
// PrintSummary prints a summary of the comparison
func (r *ComparisonResult) PrintSummary() {
fmt.Println("\n" + strings.Repeat("=", 70))
fmt.Println(" MESSAGE VERIFICATION RESULTS")
fmt.Println(strings.Repeat("=", 70))
fmt.Printf("\nProduction Summary:\n")
fmt.Printf(" Total Produced: %d messages\n", r.TotalProduced)
fmt.Printf("\nConsumption Summary:\n")
fmt.Printf(" Total Consumed: %d messages (from current test)\n", r.TotalConsumed)
fmt.Printf(" Unique Consumed: %d messages\n", r.UniqueConsumed)
fmt.Printf(" Duplicate Reads: %d messages\n", r.TotalConsumed-r.UniqueConsumed)
if r.FilteredOldCount > 0 {
fmt.Printf(" Filtered Old: %d messages (from previous tests, not tracked)\n", r.FilteredOldCount)
}
fmt.Printf("\nVerification Results:\n")
if r.MissingCount == 0 {
fmt.Printf(" ✅ Missing Records: 0 (all messages delivered)\n")
} else {
fmt.Printf(" ❌ Missing Records: %d (data loss detected!)\n", r.MissingCount)
}
if r.DuplicateCount == 0 {
fmt.Printf(" ✅ Duplicate Records: 0 (no duplicates)\n")
} else {
duplicatePercent := float64(r.TotalConsumed-r.UniqueConsumed) * 100.0 / float64(r.TotalProduced)
fmt.Printf(" ⚠️ Duplicate Records: %d unique messages read multiple times (%.1f%%)\n",
r.DuplicateCount, duplicatePercent)
}
fmt.Printf("\nDelivery Guarantee:\n")
if r.MissingCount == 0 && r.DuplicateCount == 0 {
fmt.Printf(" ✅ EXACTLY-ONCE: All messages delivered exactly once\n")
} else if r.MissingCount == 0 {
fmt.Printf(" ✅ AT-LEAST-ONCE: All messages delivered (some duplicates)\n")
} else {
fmt.Printf(" ❌ AT-MOST-ONCE: Some messages lost\n")
}
// Print sample of missing records (up to 10)
if len(r.Missing) > 0 {
fmt.Printf("\nSample Missing Records (first 10 of %d):\n", len(r.Missing))
for i, record := range r.Missing {
if i >= 10 {
break
}
fmt.Printf(" - %s[%d]@%d (key=%s)\n",
record.Topic, record.Partition, record.Offset, record.Key)
}
}
// Print sample of duplicate records (up to 10)
if len(r.Duplicates) > 0 {
fmt.Printf("\nSample Duplicate Records (first 10 of %d):\n", len(r.Duplicates))
// Sort by count descending
sorted := make([]DuplicateRecord, len(r.Duplicates))
copy(sorted, r.Duplicates)
sort.Slice(sorted, func(i, j int) bool {
return sorted[i].Count > sorted[j].Count
})
for i, dup := range sorted {
if i >= 10 {
break
}
fmt.Printf(" - %s[%d]@%d (key=%s, read %d times)\n",
dup.Record.Topic, dup.Record.Partition, dup.Record.Offset,
dup.Record.Key, dup.Count)
}
}
fmt.Println(strings.Repeat("=", 70))
}
func sumDuplicates(duplicates []DuplicateRecord) int {
sum := 0
for _, dup := range duplicates {
sum += dup.Count - 1 // Don't count the first occurrence
}
return sum
}