-
Notifications
You must be signed in to change notification settings - Fork 296
Feature/mst shared limit #2230
base: feature/shared-storage-limit
Are you sure you want to change the base?
Feature/mst shared limit #2230
Conversation
Signed-off-by: Mikhail Boldyrev <[email protected]>
Signed-off-by: Mikhail Boldyrev <[email protected]>
Signed-off-by: Mikhail Boldyrev <[email protected]>
Signed-off-by: Mikhail Boldyrev <[email protected]>
Signed-off-by: Mikhail Boldyrev <[email protected]>
53a93e7
to
b83b172
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.
Thanks! Cool
if (not pcs_->propagate_batch(moved_batch->get())) { | ||
if (not pending_batches_.insert(std::move(moved_batch))) { | ||
log_->critical( | ||
"Dropped a completed MST batch because no place left in storage: {}", |
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.
Usually, space is used in that context (even if place is more technically correct because it is internals that are not an object of interest for the external interface user).
"Dropped a completed MST batch because no place left in storage: {}", | |
"Dropped a completed MST batch because no space left in storage: {}", |
|
||
bool MstToPcsPropagation::InternalStorage::insert(BatchPtr batch) { | ||
pending_batches.emplace_back(std::move(batch)); | ||
return true; |
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.
Unconditional return type 🤔
auto completed_batches = batches_.move([this, &state_update, &rhs_batch]( | ||
auto &storage) | ||
-> std::vector<BatchPtr> { | ||
auto corresponding = storage.batches.right.find(rhs_batch); |
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.
I would be very glad if you will use any other variable name instead of "corresponding". Hope this is possible.
Description of the Change
Reworked completed MST batches propagation to PCS:
MstToPcsPropagation
MstToPcsPropagation
tries to pass them to PCSMstToPcsPropagation
waits till a notification with available room for transactions and resends the fitting batchesMstToPcsPropagation
uses the same shared limit with the rest MST batches storages, which prevents new batches from being accepted until previously accepted either expire or come to PCS.Benefits
Solves the memory growth problem.
Possible Drawbacks
Usage Examples or Tests [optional]
Please see
mst_to_psc_propagation_test
.Alternate Designs [optional]