Skip to content
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

feat(redis): exit with error for possible DB corruption #220

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Mar 17, 2022

What did you implement:

When the Insert update process was broken, these PRs(#164, #175) implemented log output and the removal of the definition ID that caused the error, thus avoiding the constant errors.

The bug in the Insert update process should have been fixed in this PR(#177).

This should be an error because the Redis relation may be broken.
I also think that Get is preferable to ReadOnly.

Fixes #210

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

$ redis-cli -p 6379
127.0.0.1:6379> SMEMBERS OVAL#ubuntu#20#PKG#bird
1) "oval:com.ubuntu.focal:def:2019161590000000"
2) "oval:com.ubuntu.focal:def:2018120660000000"
127.0.0.1:6379> SADD OVAL#ubuntu#20#PKG#bird oval:com.ubuntu.focal:def:test
(integer) 1
127.0.0.1:6379> SMEMBERS OVAL#ubuntu#20#PKG#bird
1) "oval:com.ubuntu.focal:def:test"
2) "oval:com.ubuntu.focal:def:2019161590000000"
3) "oval:com.ubuntu.focal:def:2018120660000000"

$ goval-dictionary server --debug --dbtype redis --dbpath "redis://127.0.0.1:6379/0"
DBUG[03-17|17:30:31] Params                                   Family=ubuntu Release=20 Pack=bird DecodePack=bird arch=
EROR[03-17|17:30:31] Failed to get by Package Name.           err="Failed to HMGet. Redis relationship may be broken. err: Some fields do not exist. family: ubuntu, version: 20, defID: oval:com.ubuntu.focal:def:test"
{"time":"2022-03-17T17:30:31.90360012+09:00","id":"","remote_ip":"127.0.0.1","host":"127.0.0.1:1324","method":"GET","uri":"/packs/ubuntu/20/bird","user_agent":"curl/7.68.0","status":200,"error":"","latency":1561944,"latency_human":"1.561944ms","bytes_in":0,"bytes_out":5}

$ curl http://127.0.0.1:1324/packs/ubuntu/20/bird
null

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@kotakanbe
Copy link
Collaborator

Check the operation of the refresh process with the Redis backend for a while before merging.

@kotakanbe kotakanbe merged commit e0a5097 into master Apr 20, 2023
@kotakanbe kotakanbe deleted the MaineK00n/change-get-in-redis branch April 20, 2023 08:13
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.

border effect when reading data : redis::GetByPackName - breaks on a redis cluster with RO slaves
2 participants