-
Notifications
You must be signed in to change notification settings - Fork 55
editoast: adapt edition endpoint using zadd #12526
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
editoast: adapt edition endpoint using zadd #12526
Conversation
92a5674
to
da4c4ec
Compare
Signed-off-by: SarrahElm <[email protected]>
da4c4ec
to
17617b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Therefore, I found a big issue in our conception.
@Khoyo While testing this PR I found out that we can not push duplicate values with different zindex.
Here an example where I've edited a detector position from 2820
-> 2821
-> 2820
-> 2819
. We only have three values instead of four.
1) "[{\"Update\":{\"Detector\":{\"obj_id\":\"DB0\",\"track\":\"TB0\",\"position\":2820.0}}}]"
2) "[{\"Update\":{\"Detector\":{\"obj_id\":\"DB0\",\"track\":\"TB0\",\"position\":2821.0}}}]"
3) "[{\"Update\":{\"Detector\":{\"obj_id\":\"DB0\",\"track\":\"TB0\",\"position\":2819.0}}}]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Indeed. We could wrap those in a struct with a 64 bit nonce to avoid that behavior, wdyt? |
Sounds good to me. |
5bf08a5
to
f314f94
Compare
…ons stored in valkey Signed-off-by: SarrahElm <[email protected]>
f314f94
to
7f22438
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix 👍
Close #12432
Firstly, I adapt InfraCache to store the infra_version version of the current infrastructure.
Then, I adapt the apply_edit function (called by the edition endpoint) to store cache operations in valkey using zadd, as follows :