-
Notifications
You must be signed in to change notification settings - Fork 1
Comparing changes
Open a pull request
base repository: cilium/statedb
base: v0.3.0
head repository: cilium/statedb
compare: v0.3.1
- 9 commits
- 40 files changed
- 1 contributor
Commits on Sep 30, 2024
-
testutils: Add script-based test utilities
Add generic testscript commands for testing against StateDB tables. This allows implementing tests as scripts, which becomes useful when tests perform multiple steps on tables and need to verify the output each step. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for da44c74 - Browse repository at this point
Copy the full SHA da44c74View commit details
Commits on Oct 7, 2024
-
Add a quickcheck test for StateDB
Add a test using testing/quick for StateDB to validate queries against unique and non-unique indexes. This catches the two issues with non-unique indexes: - Prefix and LowerBound did not properly seek according to the search key (e.g. secondary key) and matched against the composite instead, e.g. if we have composite keys <a><aa><1> ("aaa1") and <aa><b><2> (aab2) and prefix search for "aa" we'll yield the object with composite key <a><aa><1> incorrectly as we did not check if the secondary key length (1) matches with search key "aa" (2). (non-unique keys are encoded as <secondary><primary><secondary length>, see encodeNonUniqueKey for details) - Since there's no separator between the secondary and primary key in the encoding, the iteration order for <a><z><1> and <aa><a><2> will be <aa><a><2>, <a><z><1>, but it should be <a><z><1>, <aa><a><2> since "a" < "aa". Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for 1ab5622 - Browse repository at this point
Copy the full SHA 1ab5622View commit details -
Add regression test for non-unique searches
Add a regression test to validate searching non-unique indexes. This more clearly shows the issues found by the TestDB_Quick that was added by the previous commit. See the previous commit for more details. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for af31f0a - Browse repository at this point
Copy the full SHA af31f0aView commit details -
Fix Prefix and LowerBound on non-unique indexes
Prefix and LowerBound searches did not properly deal with non-unique indexes. In these indexes the keys are encoded as <secondary><primary><secondary len>, and prefix searching needs to make sure the secondary key length on the results is equal or longer than the search key as otherwise we might match into the primary key. For example if the object is struct{A, B string}, with A being primary and we have {"a", "a"}, then the secondary index is key'd as "aa<1>". A prefix search with "aa" must not match since the secondary index contains only an object with key "a". Fix this by using a special iteration on non-unique indexes that checks the length of the secondary key and ignores any other matches that are due to matching into the primary key. Another issue with non-unique indexes was due to having no separator between the secondary and primary key, leading to the primary key having an effect on the iteration order. Fix this by adding '\0' as a separator and base64+sha256'ing the primary key. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for 62157fc - Browse repository at this point
Copy the full SHA 62157fcView commit details
Commits on Oct 10, 2024
-
Bring in the new hive version that includes the script support. Fix the API usage. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for 0f24f74 - Browse repository at this point
Copy the full SHA 0f24f74View commit details -
part: Add YAML support to Set and Map
To allow using part.Set[] and part.Map[] types with the YAML marshalling/unmarshalling in the StateDB script commands, add the custom YAML marshalling and unmarshalling methods for these types. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for 70dced9 - Browse repository at this point
Copy the full SHA 70dced9View commit details -
Reimplement script commands against hive script
Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for 232e3d0 - Browse repository at this point
Copy the full SHA 232e3d0View commit details -
reconciler: Implement tests using scripttest
Reimplement the reconciler tests using scripttest. This significantly simplifies the test-suite and allows easier verification of more complex scenarios. To allow for Status JSON and YAML marshalling, define custom UnmarshalJSON and UnmarshalYAML that also fill in the 'id'. The 'id' is used with StatusSet to efficiently allow multiple reconcilers to manipulate the status without conflicts, e.g. if the object status id is the same it can still be updated with the reconciliation result even if the object conflicted due to other reconciler's update to its status. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for 43587d4 - Browse repository at this point
Copy the full SHA 43587d4View commit details -
Add *String counterparts (Int32 => Int32String) for implementing FromString in Index[]. Signed-off-by: Jussi Maki <jussi.maki@isovalent.com>
Configuration menu - View commit details
-
Copy full SHA for c6862eb - Browse repository at this point
Copy the full SHA c6862ebView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.3.0...v0.3.1