-
Notifications
You must be signed in to change notification settings - Fork 235
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
Problem: memiavl don't recover corrupted wal tail #1073
Conversation
Solution: - fix in wal and update dependencies
Codecov Report
@@ Coverage Diff @@
## main #1073 +/- ##
==========================================
- Coverage 46.53% 46.13% -0.40%
==========================================
Files 81 82 +1
Lines 7135 7203 +68
==========================================
+ Hits 3320 3323 +3
- Misses 3462 3522 +60
- Partials 353 358 +5
|
Signed-off-by: yihuang <[email protected]>
9c0486e
to
8c9df59
Compare
Signed-off-by: yihuang <[email protected]>
if uint64(len(data)-n) < size { | ||
return 0, wal.ErrCorrupt | ||
} | ||
return n + int(size), nil |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
if n <= 0 { | ||
return 0, wal.ErrCorrupt | ||
} | ||
if uint64(len(data)-n) < size { |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
"io/ioutil" | ||
"os" | ||
"path/filepath" | ||
"unsafe" |
Check failure
Code scanning / gosec
Blocklisted import unsafe
return 0, wal.ErrCorrupt | ||
} | ||
line := data[:idx] | ||
dres := gjson.Get(*(*string)(unsafe.Pointer(&line)), "data") |
Check warning
Code scanning / gosec
Use of unsafe calls should be audited
Solution:
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)