Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(split): re-implement function split_replica_exec #399

Merged
merged 7 commits into from
Mar 19, 2020

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Feb 14, 2020

This pull request is re-implementing function split_replica_exec. During partition split, parent/child may want child/parent to execute another function, split_replica_exec is used for such function.

To simplify description, we assume that parent want child to execute function A. Parent replica calls function split_replica_exec directly, if child replica can be found on this replica_stub, child will execute function A, otherwise, parent will execute another function, usually is an error handler.

In current design, replica should execute functions in a same thread, whose id is calculated by its pid. However, split_replica_exec will let child replica execute function A in parent's thread, whose id is usually different from child's.

As a result, I re-implement split_replica_exec. Parent replica still calls function split_replica_exec directly, if child replica can be found on this replica_stub, replica_stub use tasking::enqueue to guarantee child replica execute function A in its own thread, and return ERR_OK, otherwise, return ERR_OBJECT_NOT_FOUND. Parent will execute the error handler if it got ERR_OBJECT_NOT_FOUND from split_replica_exec.

This pull request also updates unit tests and removes some useless cases.

@hycdong hycdong changed the title feat(split): refactor function split_replica_exec [WIP] feat(split): re-implement function split_replica_exec Mar 12, 2020
@hycdong hycdong marked this pull request as ready for review March 12, 2020 08:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants