Skip to content

test: analyzer bot test PR - #1

Open
Ariznawlll wants to merge 1 commit into
mainfrom
test-analyzer-bot
Open

test: analyzer bot test PR#1
Ariznawlll wants to merge 1 commit into
mainfrom
test-analyzer-bot

Conversation

@Ariznawlll

Copy link
Copy Markdown
Owner

Testing the PR analyzer bot

@Ariznawlll

Copy link
Copy Markdown
Owner Author

/analyze-pr

mergify Bot pushed a commit that referenced this pull request May 7, 2026
…origin#24117)

Move postEvict callbacks (value.Release + metrics updates) outside the global `queueLock` in the FIFO cache to eliminate lock convoy under memory pressure.

### Root Cause

When MemCache (12GB FIFO cache) is 100% full, every `Set()` triggers `Evict()` which holds the global `queueLock` while executing `postEvict` callbacks. Under GC pressure (STW pauses up to ~1s), this creates a lock convoy where all concurrent cache operations serialize through the single lock:

- Each `Set()` takes **300-444ms** (normal: <0.1ms, 3000-4400x slower)
- Queries with ~90 cache ops inflate from 1-5s to **60-107s**
- Exceeds client-side timeouts → **connection disconnections**

Evidence from fileservice slow event trace:
```
Single S3FS.Read (total: 798ms) breakdown:
disk cache read:            35ms
set memory cache entry #1: 318ms  ← queueLock wait + eviction
set memory cache entry #2: 444ms  ← queueLock wait + eviction
762ms (95%) spent in "set memory cache entry"
```

### Fix

1. Collect evicted items under `queueLock` into a pending list
2. Release `queueLock`
3. Execute `postEvict` callbacks (value.Release + metrics) outside the lock

The `item.valueOK` flag is still set to `false` under the **shard lock** (not queueLock) to prevent data races with concurrent `Get()` calls.

### Impact

In stability testing (commit 725b723):
- **TPCC**: 40 "Communications link failure" events
- **Fulltext**: 57 "Lost connection" events
- **Sysbench**: 0 errors (point queries <5s skip tombstone transfer)

Approved by: @gouhongshen, @XuPeng-SH, @fengttt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant