Repository navigation
feat: report active_extern_txms in INFO stats #531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
64816e1
04bc059
eee3320
b60dc90
4a8585a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # AGENTS.md | ||
|
|
||
| Agent guidance for the **EloqKV** repo (Redis/Valkey-compatible distributed DB; | ||
| transaction/storage engine lives in the `data_substrate` submodule). | ||
|
|
||
| **Read [CLAUDE.md](CLAUDE.md) first** — it is the source of truth for | ||
| architecture, the build/test commands, and code style. This file only restates | ||
| the operational essentials plus a few facts that are otherwise hard to discover. | ||
|
|
||
| ## Build & run (short form; see CLAUDE.md for full flags) | ||
|
|
||
| ```bash | ||
| mkdir -p bld && cd bld | ||
| cmake .. -DWITH_DATA_STORE=ELOQDSS_ELOQSTORE -DWITH_LOG_STATE=ROCKSDB \ | ||
| -DCMAKE_INSTALL_PREFIX=../install | ||
| cmake --build . --parallel "$(nproc)" && cmake --install . | ||
| cd .. # install/ and eloqkv.ini are at the repo root | ||
| ./install/bin/eloqkv --config=eloqkv.ini # single node, port 6379, foreground | ||
| ``` | ||
|
|
||
| ## Where are the logs? | ||
|
|
||
| Server logs are **glog** files that default to **`install/logs/`** — i.e. | ||
| `<install_prefix>/logs`, resolved relative to the binary, **not** the current | ||
| working directory. You'll find: | ||
|
|
||
| - `eloqdb.log.INFO` / `eloqdb.log.WARNING` / `eloqdb.log.ERROR` | ||
| - `host_manager.log.*` | ||
|
|
||
| The `*.INFO` / `*.WARNING` entries are symlinks pointing at the current | ||
| timestamped file (`eloqdb.log.INFO.YYYYMMDD-HHMMSS.<pid>`). | ||
|
|
||
| Discoverability note: nothing states this default except the startup banner | ||
| (`Running logs will be written to the following path: …/install/logs`). `--help` | ||
| only documents `--log_dir` as the *override*, never the default. To send logs | ||
| elsewhere, pass `--log_dir=<dir>` (or `--logtostderr` to log to stderr instead). | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -309,6 +309,73 @@ start_server {tags {"multi"}} { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert_equal "*-1" [exec_raw] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # INFO # Stats gauge of live external transactions (#528). The suite's | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # s/status helpers only fetch the clients section, so read stats directly. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Configs with data store + WAL keep a nonzero, slightly jittery background | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # baseline, so the assertions are baseline-relative and use controlled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # signals large enough to dominate that noise. `txms_floor` samples the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # low-water mark over a short window (background daemons only add txms, so | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # the minimum approximates the quiescent baseline). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| proc active_txms {} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getInfoProperty [r info stats] active_extern_txms | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| proc txms_floor {} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set m [active_txms] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for {set i 0} {$i < 5} {incr i} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| after 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set v [active_txms] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if {$v < $m} { set m $v } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return $m | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test {active_extern_txms gauge is live and empty EXEC does not leak txms (#528)} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Positive control: hold N concurrent BEGIN sessions (each a live extern | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # txm). The gauge must rise by ~N and fall back after rollback — a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # dead/constant gauge cannot pass. N is large enough that a few | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # background completions can't mask the rise. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set N 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set base [txms_floor] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set conns {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for {set i 0} {$i < $N} {incr i} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set c [redis_client] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $c begin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| lappend conns $c | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wait_for_condition 50 100 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [active_txms] >= $base + $N - 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail "gauge did not rise by ~$N held BEGIN txms over base $base: [active_txms]" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } finally { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach c $conns { catch {$c rollback}; $c close } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+341
to
+352
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Register each client before issuing If Proposed cleanup fix for {set i 0} {$i < $N} {incr i} {
set c [redis_client]
- $c begin
lappend conns $c
+ $c begin
}
@@
- foreach c $conns { catch {$c rollback}; $c close }
+ foreach c $conns {
+ catch {$c rollback}
+ catch {$c close}
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wait_for_condition 50 100 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [txms_floor] <= $base + 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail "gauge did not return to base $base after rolling back $N BEGINs: [txms_floor]" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Regression for the #506 leak class: a large batch of empty WATCH/EXEC | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # cycles must not accumulate outstanding txms. A one-per-cycle leak adds | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # +$cycles, which dwarfs the whole baseline even if it fully drained; a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # healthy gauge settles back to the floor. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set cycles 100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set base [txms_floor] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r set x 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for {set j 0} {$j < $cycles} {incr j} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r watch x | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| r multi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert_equal "*0" [exec_raw] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wait_for_condition 50 100 { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [txms_floor] <= $base + 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail "empty WATCH/EXEC cycles leaked extern txms above base $base: [txms_floor]" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert {[string is integer -strict [active_txms]]} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # TODO: transaction conflict with flushdb/flushall. issue tracked. (tx1:watch-multi/exec; tx2:flushdb) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # test {FLUSHALL is able to touch the watched keys} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # r set x 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.