Skip to content

Conversation

@Ryan4253
Copy link
Contributor

@Ryan4253 Ryan4253 commented Jun 4, 2025

Closes #3008

Description of Changes:

EventListener::OnFlushCompleted currently logs the enum directly in the reason field. This commit switches to logging the reason string instead which gives better ergonomics when reading logs.

Test Plan:

Unit Test

----------] Global test environment tear-down
[==========] 430 tests from 69 test suites ran. (18988 ms total)
[  PASSED  ] 429 tests.
[  SKIPPED ] 1 test, listed below:
[  SKIPPED ] UseBitmap/RedisBitmapTest.BitfieldStringGetSetTest/0

Logs:

Before:

[2025-06-03T14:30:37.476414-04:00][I][event_listener.cc:137] [event_listener/flush_completed] column family: metadata, thread_id: 87921, job_id: 11, file: [dir]/kvrocks/db/000477.sst, reason: 6, is_write_slowdown: no, is_write_stall: no, largest seqno: 15602, smallest seqno: 15256

After:

[2025-06-03T10:45:33.144102-04:00][I][event_listener.cc:145] [event_listener/flush_completed] column family: metadata, thread_id: 121487, job_id: 6, file: [dir]/kvrocks/db/000110.sst, reason: Write Buffer Full, is_write_slowdown: no, is_write_stall: no, largest seqno: 4096, smallest seqno: 3754

PragmaTwice
PragmaTwice previously approved these changes Jun 4, 2025
git-hulk
git-hulk previously approved these changes Jun 4, 2025
@git-hulk git-hulk changed the title fix(event): Log reason string instead of id in EventListener::OnFlushCompleted fix(event): should log reason string instead of id in EventListener::OnFlushCompleted Jun 4, 2025
@Ryan4253 Ryan4253 dismissed stale reviews from git-hulk and PragmaTwice via 84b3097 June 4, 2025 15:14
@Ryan4253 Ryan4253 requested review from PragmaTwice and git-hulk June 4, 2025 15:16
@mapleFU
Copy link
Member

mapleFU commented Jun 4, 2025

Seems failed ut unrelated, would retrigger ci before merging

--- FAIL: TestBloomInfo (10.12s)
    --- FAIL: TestBloomInfo/MAdd_scaling_Test (0.02s)
        bloom_test.go:243: 
            	Error Trace:	/Users/runner/work/kvrocks/kvrocks/tests/gocase/unit/type/bloom/bloom_test.go:243
            	Error:      	Not equal: 
            	            	expected: []interface {}{"Capacity", 210, "Size", 896, "Number of filters", 3, "Number of items inserted", 91, "Expansion rate", 2}
            	            	actual  : []interface {}{"Capacity", 90, "Size", 384, "Number of filters", 2, "Number of items inserted", 90, "Expansion rate", 2}

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 5, 2025

@PragmaTwice PragmaTwice merged commit 15592c4 into apache:unstable Jun 5, 2025
36 checks passed
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.

EventListener::OnFlushCompleted logs enum instead of string for reason

4 participants