Skip to content

Commit 55fb07d

Browse files
authored
Merge branch 'unstable' into fix/rdb-skip-expired-fields
Signed-off-by: Hanxi Zhang <hanxizh@amazon.com>
2 parents 2827aa0 + c1b4129 commit 55fb07d

658 files changed

Lines changed: 21822 additions & 7339 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"duration": 180,
4+
"keyspacelen": [3000000],
5+
"data_sizes": [16,96],
6+
"pipelines": [1, 10],
7+
"clients": [1600],
8+
"commands": [
9+
"SET",
10+
"GET"
11+
],
12+
"cluster_mode": false,
13+
"tls_mode": false,
14+
"warmup": 30,
15+
"io-threads": [1,9],
16+
"benchmark-threads": 90,
17+
"server_cpu_range": "0-8",
18+
"client_cpu_range": "96-191"
19+
}
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"duration": 180,
4+
"keyspacelen": [3000000],
5+
"data_sizes": [16,96],
6+
"pipelines": [1, 10],
7+
"clients": [1600],
8+
"commands": [
9+
"SET",
10+
"GET"
11+
],
12+
"cluster_mode": false,
13+
"tls_mode": false,
14+
"warmup": 30,
15+
"io-threads": [1,9],
16+
"benchmark-threads": 90,
17+
"server_cpu_range": "0-8",
18+
"client_cpu_range": "144-191,48-95"
19+
}
20+
]

.github/benchmark_configs/pr_benchmark.json

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/copilot-instructions.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Valkey Project Instructions
2+
3+
You are an expert code reviewer for the Valkey project. Provide helpful, constructive feedback on code quality, safety, and adherence to project standards.
4+
5+
## 1. Review Tone & Focus
6+
- **Tone:** Be professional, direct, constructive, and empathetic.
7+
- **Focus:** Critique the *code*, never the *person*.
8+
- **Constructive:** Suggest improvements, explain *why*, provide examples.
9+
10+
## 2. Critical Checks
11+
- **DCO:** **Flag missing** `Signed-off-by: Name <email>` in commits. Every commit needs it.
12+
- **Security:** If PR fixes a security vulnerability, flag it: "Security fixes should be reported privately to security@lists.valkey.io, not via public PRs."
13+
14+
## 3. Major Decision Detection
15+
Flag PRs that appear to be "Technical Major Decisions" requiring TSC consensus:
16+
- Fundamental changes to core datastructures
17+
- New data structures or APIs
18+
- Backward compatibility breaks
19+
- New user-visible fields requiring long-term maintenance
20+
- New external libraries affecting runtime behavior
21+
22+
**Action:** Comment mentioning **@core-team** that this appears to require TSC review and ask if consensus was reached in a linked Issue.
23+
24+
## 4. Documentation Reminder
25+
If PR changes user-facing behavior (new commands, changed semantics, new config):
26+
- **Remind** author that docs at [valkey-doc](https://github.com/valkey-io/valkey-doc) may need updating.
27+
- **Suggest** linking PR to related Issue with "Fixes #xyz" pattern if applicable.
28+
29+
## 5. Governance Changes
30+
**ANY change to `GOVERNANCE.md`** requires special attention - comment mentioning **@core-team** for review.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
applyTo:
3+
- "src/**/*.{c,h}"
4+
- "valkey.conf"
5+
---
6+
7+
# Valkey Core Engine Review Standards
8+
9+
Apply these standards to core engine C code. Do NOT apply to `deps/` (vendored dependencies).
10+
11+
## 1. Code Style (from DEVELOPMENT_GUIDE.md)
12+
- **Formatting:** Follow clang-format (4-space indent, no tabs, braces attached).
13+
- **Comments:**
14+
- C-style `/* ... */` for single or multi-line.
15+
- C++ `//` only for single-line.
16+
- Multi-line: align leading `*`, final `*/` on last text line.
17+
- Document *why* code exists, not just *what*. Document all functions.
18+
- **Line Length:** Keep below 90 characters when reasonable.
19+
- **Types:** Use the boolean type for true/false values.
20+
- **Static:** Use `static` for file-local functions.
21+
22+
## 2. Naming Conventions
23+
- **Variables:** `snake_case` or lowercase (e.g. `cached_reply`, `keylen`).
24+
- **Functions:** `camelCase` or `namespace_camelCase` (e.g. `createStringObject`, `IOJobQueue_isFull`).
25+
- **Macros:** `UPPER_CASE` (e.g. `MAKE_CMD`).
26+
- **Structures:** `camelCase` (e.g. `user`).
27+
28+
## 3. Safety & Correctness
29+
- **Memory:** Strict check for buffer overflows and leaks.
30+
- **Strings:** Validate `sds` string handling.
31+
- **Concurrency:** Verify thread safety in threaded I/O paths.
32+
33+
## 4. Design Guidelines
34+
- **Configuration:** Avoid new configs if heuristics suffice. Only add for explicit trade-offs (CPU vs memory).
35+
- **Metrics:** No new metrics on hot paths without zero-overhead proof.
36+
- **PR Scope:** Separate refactoring from functional changes for easier backporting.
37+
38+
## 5. Testing & Documentation
39+
- **Unit Tests:** Required for data structures in `src/unit/`. Test files should follow `test_*.c` naming.
40+
- **Integration Tests:** Required for commands in `tests/`.
41+
- **Command Changes:** New/modified commands need corresponding updates in `src/commands/*.json`.
42+
- **New C Files:** Remind to update `CMakeLists.txt` when adding new `.c` source files.
43+
- **License:** New files need BSD-3-Clause header. Material changes (>100 lines) also require it.
44+
- **Documentation:** User-facing changes need docs at [valkey-doc](https://github.com/valkey-io/valkey-doc).
45+
46+
## 6. Critical Escalation
47+
- **Trigger:** Changes to `cluster*.c`, `replication.c`, `rdb.c`, `aof.c`.
48+
- **Action:** Comment mentioning **@core-team** to request architectural review.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
applyTo:
3+
- "tests/**/*.tcl"
4+
---
5+
6+
# Valkey Integration Test Review Standards
7+
8+
Apply these standards to Tcl-based integration tests (from DEVELOPMENT_GUIDE.md).
9+
10+
## 1. Test Organization
11+
- **Cluster:** Use `tests/unit/cluster/` (NOT legacy `tests/cluster/` which is deprecated).
12+
- **Coverage:** All contributions should include tests. New commands require integration tests.
13+
- **Naming:** Use descriptive test names that explain what is being tested.
14+
15+
## 2. Test Quality
16+
- **Isolation:** Tests should not depend on execution order.
17+
- **Cleanup:** Ensure proper cleanup of resources and temporary files.
18+
- **Assertions:** Use clear assertions with meaningful error messages.
19+
20+
## 3. Best Practices
21+
- **Readability:** Keep tests simple and focused on one scenario.
22+
- **Reliability:** Avoid timing-dependent tests; use proper synchronization.
23+
- **Documentation:** Comment complex test scenarios to explain intent.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
applyTo:
3+
- "utils/**/*"
4+
---
5+
6+
# Valkey Utilities Review Standards
7+
8+
Apply these standards to utility scripts and tools.
9+
10+
## 1. Script Quality
11+
- **Portability:** Scripts should work across common platforms (Linux, macOS).
12+
- **Error Handling:** Check for errors and provide clear error messages.
13+
- **Documentation:** Include usage instructions in comments or help text.
14+
15+
## 2. Code Standards
16+
- **Python:** Follow PEP 8 style guidelines.
17+
- **Ruby:** Follow standard Ruby conventions.
18+
- **Shell:** Use shellcheck-compatible patterns.
19+
- **C Tools:** Follow LLVM style (4-space indent, no tabs).
20+
21+
## 3. Best Practices
22+
- **Dependencies:** Minimize external dependencies.
23+
- **Safety:** Validate inputs and avoid destructive operations without confirmation.
24+
- **Maintainability:** Keep utilities simple and well-commented.

.github/workflows/benchmark-on-label.yml

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: On-demand Benchmark
1+
name: On-Demand Labeled Benchmark
22

33
on:
44
pull_request_target:
55
types: [labeled]
66

77
concurrency:
8-
group: valkey-benchmark
8+
group: ec2-al-2023-pr-benchmarking-arm64
99
cancel-in-progress: false
1010

1111
defaults:
@@ -19,9 +19,12 @@ permissions:
1919

2020
jobs:
2121
benchmark:
22-
runs-on: ${{ github.repository == 'valkey-io/valkey' && fromJSON('["self-hosted","ec2-ubuntu-24.04-benchmarking"]') || 'ubuntu-latest' }}
2322
if: |
24-
github.event.action == 'labeled' && github.event.label.name == 'run-benchmark'
23+
github.event.action == 'labeled' && github.event.label.name == 'run-benchmark' &&
24+
github.repository == 'valkey-io/valkey'
25+
26+
runs-on: ["self-hosted", "ec2-al-2023-pr-benchmarking-arm64"]
27+
timeout-minutes: 7200
2528
steps:
2629
- name: Checkout valkey
2730
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -39,36 +42,65 @@ jobs:
3942
fetch-depth: 1
4043
persist-credentials: false
4144

45+
- name: Checkout valkey for latest benchmark.
46+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
47+
with:
48+
repository: valkey-io/valkey
49+
ref: "unstable"
50+
path: valkey_latest
51+
fetch-depth: 0
52+
persist-credentials: false
53+
4254
- name: Set up Python
43-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
55+
uses: kishaningithub/setup-python-amazon-linux@63dc7bd642c6a564d0a93dd4b1cbe3e448ce3621 # v1.0.18
4456
with:
4557
python-version: "3.10"
4658
cache: "pip"
4759

4860
- name: Install dependencies
4961
working-directory: valkey-perf-benchmark
5062
run: |
51-
sudo apt-get update
52-
sudo apt-get install -y build-essential
63+
sudo dnf groupinstall "Development Tools" -y
64+
sudo dnf install -y gcc gcc-c++ make \
65+
python3-devel \
66+
openssl-devel \
67+
bzip2-devel \
68+
libffi-devel
5369
pip install -r requirements.txt
5470
71+
- name: Build latest valkey_latest
72+
working-directory: valkey_latest
73+
run: |
74+
echo "Building latest valkey-benchmark for latest benchmark executable..."
75+
make distclean || true
76+
make -j
77+
if [[ -f "src/valkey-benchmark" ]]; then
78+
echo "Successfully built latest valkey-benchmark"
79+
ls -la src/valkey-benchmark
80+
./src/valkey-benchmark --version || echo "Version check completed"
81+
else
82+
echo "Failed to build valkey-benchmark"
83+
exit 1
84+
fi
85+
VALKEY_BENCHMARK_PATH="$(pwd)/src/valkey-benchmark"
86+
echo "VALKEY_BENCHMARK_PATH=$VALKEY_BENCHMARK_PATH" >> $GITHUB_ENV
87+
echo "Latest valkey-benchmark path: $VALKEY_BENCHMARK_PATH"
88+
5589
- name: Run benchmarks
5690
working-directory: valkey-perf-benchmark
5791
run: |
58-
CONFIG_FILE="../valkey/.github/benchmark_configs/pr_benchmark.json"
59-
60-
# Removes server/client CPU range args if running in private repo
61-
if [[ "${{ github.repository }}" != "valkey-io/valkey" ]]; then
62-
jq 'map(del(.server_cpu_range, .client_cpu_range))' "$CONFIG_FILE" > tmp.json && mv tmp.json "$CONFIG_FILE"
63-
fi
92+
CONFIG_FILE="../valkey/.github/benchmark_configs/benchmark-config-arm.json"
6493
6594
# Base benchmark arguments
6695
BENCHMARK_ARGS=(
96+
--config "$CONFIG_FILE"
6797
--commits "${{ github.event.pull_request.merge_commit_sha }}"
6898
--baseline "${{ github.event.pull_request.base.ref }}"
69-
--results-dir "results"
99+
--valkey-benchmark-path "$VALKEY_BENCHMARK_PATH"
100+
--target-ip ${{ secrets.EC2_ARM64_IP }}
70101
--valkey-path "../valkey"
71-
--config "$CONFIG_FILE"
102+
--results-dir "results"
103+
--runs 5
72104
)
73105
74106
# Run benchmark
@@ -78,9 +110,10 @@ jobs:
78110
working-directory: valkey-perf-benchmark
79111
run: |
80112
python ./utils/compare_benchmark_results.py \
81-
./results/${{ github.event.pull_request.base.ref }}/metrics.json \
82-
./results/${{ github.event.pull_request.merge_commit_sha }}/metrics.json \
83-
../comparison.md
113+
--baseline ./results/${{ github.event.pull_request.base.ref }}/metrics.json \
114+
--new ./results/${{ github.event.pull_request.merge_commit_sha }}/metrics.json \
115+
--output ../comparison.md \
116+
--metrics rps
84117
85118
- name: Upload artifacts
86119
if: always()
@@ -115,10 +148,11 @@ jobs:
115148
if: always()
116149
continue-on-error: true
117150
run: |
151+
rm -rf comparison.md valkey*
118152
pkill -f valkey
119153
exit_code=$?
120154
if [ $exit_code -eq 0 ]; then
121-
echo "Killed running valkey processes"
155+
echo "Killed running valkey processes"
122156
elif [ $exit_code -eq 1 ]; then
123157
echo "No valkey processes found to kill"
124158
else

0 commit comments

Comments
 (0)