introduce cluster slots constructor / new default_for_tests api #7349#7489
introduce cluster slots constructor / new default_for_tests api #7349#7489steviez merged 8 commits intoanza-xyz:masterfrom
Conversation
|
You will also probably need to effectively call to fully initialize the service. |
c15e434 to
562ce87
Compare
|
Hey @steviez if you could have a look when you have spare few minutes 🙏 you created the issue at the first point so it seem appropriate to tag you. |
Surely. Let me read it thru and adjust the PR accordingly. |
c2d9c95 to
b610368
Compare
023cff6 to
0cbf0ca
Compare
|
@steviez if you could have a look whenever you find time 🙏 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7489 +/- ##
=========================================
- Coverage 83.1% 83.1% -0.1%
=========================================
Files 811 811
Lines 357501 357526 +25
=========================================
- Hits 297234 297226 -8
- Misses 60267 60300 +33 🚀 New features to boost your workflow:
|
|
|
||
| // Intentionally private default function to disallow uninitialized construction | ||
| #[inline] | ||
| fn default() -> Self { |
| } | ||
|
|
||
| impl ClusterSlots { | ||
| #[inline] |
There was a problem hiding this comment.
nit: Let's leave inline off of these 3 new functions and let the compiler do what it wants; these are constructors and only called once at startup so not like these are getting called in a hot path or anything
| } | ||
| } | ||
|
|
||
| /// Setup cluster slots with default values only for tests. |
There was a problem hiding this comment.
nit: I think we can drop this comment; it being DCOU + for_tests being in the name is fairly self-explanatory IMO
- remove defaults derivation for ClusterSlots - introduce private default function, to prevent uninitialized construction - introduce new api / default_for_tests as replacement to previously used default Co-authored-by: steviez <steven@anza.xyz>
0cbf0ca to
bfe9293
Compare
|
Thank you guys! :)) |
Problem
#7314 addressed an issue where ClusterSlots is initialized and used before the a root bank has been set. This stems from the struct being built via a Default trait implementation #7349
Summary of Changes
default_for_testsapi and privatedefaultimplementationcoreandvalidator