Blue/Green Cache #855
Closed
chubei
started this conversation in
Feature Requests
Replies: 4 comments 2 replies
-
Looks good to me |
Beta Was this translation helpful? Give feedback.
0 replies
-
Looks good to me |
Beta Was this translation helpful? Give feedback.
0 replies
-
@chubei As discussed, I think this should go hand in hand with migration behavior.
|
Beta Was this translation helpful? Give feedback.
2 replies
-
New version looks great. Thanks @chubei |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Blue/Green Cache
Between restarts, many bad things can happen. Ordering from good to bad:
Note that cases 2 and 3 can be treated as case 4. We just ignore whether the sources can start from checkpoint. But case 4 cannot be treated as case 2 or 3. So if we want to have a MVP checkpointing solution, case 4 should be prioritized.
Aliasing
To implement blue/green cache, we build upon the concept of cache aliasing.
Every
Cache
(be itRoCache
orRwCache
) has a unique name, and we maintain a look up table from cache name aliases to the real names.Endpoint as an alias
In app, currently we create or open the cache with the endpoint name. This will be changed to:
In API, currently we open the cache with the endpoint name. This will be changed. The API server will find the cache alias with the endpoint's name, and open the corresponding cache.
AliasRedirected
eventWhen the pointee of a cache alias is changed, the app sends an
AliasRedirected
message to all API servers through internal server.Upon receiving the message, API servers switch to the cache with the name of the new pointee.
Blur/Green cache
RoCache
andRwCache
We make a minor modification to
RoCache
andRwCache
.Upon
commit
, we requireRwCache
to store the commit checkpoint and the instant of the commit, and theRoCache
should be able to retrieve that information.Pipeline
There will be several back and forth communications between pipeline nodes, all happening before execution.
First checkpoints of the nodes are read and consistency is calculated. If the whole DAG is consistent, DAG asks each source if they can start from the checkpoint. If they all can, we are in case 1. The checkpoint information is passed to the
SinkFactory
'sbuild
method.If the DAG is inconsistent or any of the source can not start from the checkpoint, ignoring case 2 and 3, we're in case 4. The fact that we are starting from scratch is also passed to the
SinkFactory
'sbuild
method.Sink
In
build
,Sink
compares the pipeline checkpoint with the cache's checkpoint. If they are not the same,Sink
creates a newRwCache
and writes to it.Upon receiving the
SnapshottingDone
message, the endpoint's alias is redirected to the cache that's being written, andAliasRedirected
message is sent to API servers.@getdozer/dozer-dev Please check this and let me know what you think.
Beta Was this translation helpful? Give feedback.
All reactions