[
https://issues.apache.org/jira/browse/HDDS-14356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ivan Andika updated HDDS-14356:
-------------------------------
Description:
Currently, SCM HA already implemented its own SCM stateful service framework in
classes such as SCMServiceManager (with its notifyStatusChanged implementation
to respond to Ratis related events), StatefulServiceStateManager, etc. We can
implement it for OM HA to implement stateful service.
We have implemented this internally for our internal use case a long time ago,
particularly for OM Key Trash HDDS-11256 , where the key recovery service is
required to store the user-requested key recovery configuration to all OM nodes
(similar to ContainerBalancerConfiguration in Container Balancer HA).
Previously, we did not contribute this to community since there is currently no
valid use case (AFAIK all OM background services are stateless). However, it
seems that S3 object lifecycle feature might require this feature. Therefore,
we can contribute this to the community since there is now a valid use case.
The main overview and purpose of the stateful service are:
# Persist and replicate service configuration
** The interface is implemented in {{OMStatefulService}} and implemented by
{{OMStatefulServiceStateManager}}
** OM uses {{SetServiceConfiguration}} request to persistently save the OM
service framework
*** OM request and response: {{OMSetServiceConfigurationRequest}} and
{{OMSetServiceConfigurationResponse}}
*** Table: statefulServiceConfigTable ({{{}Table<String, ByteString>{}}})
# Notification mechanism when there are leader changes
** This is to ensure that only leader stateful service is running
** {{OMServiceManager#notifyStatusChanged}} and
{{OMService#notifyStatusChanged}} to notify the stateful service whenever
there is a change in leader
** {{OzoneManagerStateMachine}} Event APIs ({{{}notifyNotLeader{}}},
{{{}notifyLeaderChanged{}}}, {{{}notifyTermIndexUpdated, notifyLeaderReady{}}})
will trigger the {{notifyStatusChanged}}
*** The notification implementation is similar to {{SCMStateMachine}}
*** {{notifyTermIndexUpdated}} is only done if there is a configuration change
(i.e. OM transfer leadership, OM ratis ring update)
was:
Currently, SCM HA already implemented its own SCM stateful service framework in
classes such as SCMServiceManager (with its notifyStatusChanged implementation
to respond to Ratis related events), StatefulServiceStateManager, etc. We can
implement it for OM HA to implement stateful service.
We have implemented this internally for our internal use case a long time ago,
particularly for OM Key Trash HDDS-11256 , where the key recovery service is
required to store the user-requested key recovery configuration to all OM nodes
(similar to ContainerBalancerConfiguration in Container Balancer HA).
Previously, we did not contribute this to community since there is currently no
valid use case (AFAIK all OM background services are stateless). However, it
seems that S3 object lifecycle feature might require this feature. Therefore,
we can contribute this to the community since there is now a valid use case.
The main overview and purpose of the stateful service are:
# Persist and replicate service configuration
** The interface is implemented in {{OMStatefulService}} and implemented by
{{OMStatefulServiceStateManager}}
** OM uses {{SetServiceConfiguration}} request to persistently save the OM
service framework
*** OM request and response: {{OMSetServiceConfigurationRequest}} and
{{OMSetServiceConfigurationResponse}}
*** Table: statefulServiceConfigTable ({{{}Table<String, ByteString>{}}})
# Notification mechanism when there are leader changes
** This is to ensure that only leader stateful service is running
** {{OMServiceManager#notifyStatusChanged}} and
{{OMService#notifyStatusChanged}} to notify the {{KeyTrashRecoveryService}}
whenever there is a change in leader
** {{OzoneManagerStateMachine}} Event APIs ({{{}notifyNotLeader{}}},
{{{}notifyLeaderChanged{}}}, {{{}notifyTermIndexUpdated, notifyLeaderReady{}}})
will trigger the {{notifyStatusChanged}}
*** The notification implementation is similar to {{SCMStateMachine}}
*** {{notifyTermIndexUpdated}} is only done if there is a configuration change
(i.e. OM transfer leadership, OM ratis ring update)
> Support OM Stateful Service Framework
> -------------------------------------
>
> Key: HDDS-14356
> URL: https://issues.apache.org/jira/browse/HDDS-14356
> Project: Apache Ozone
> Issue Type: Improvement
> Reporter: Ivan Andika
> Assignee: Ivan Andika
> Priority: Major
>
> Currently, SCM HA already implemented its own SCM stateful service framework
> in classes such as SCMServiceManager (with its notifyStatusChanged
> implementation to respond to Ratis related events),
> StatefulServiceStateManager, etc. We can implement it for OM HA to implement
> stateful service.
> We have implemented this internally for our internal use case a long time
> ago, particularly for OM Key Trash HDDS-11256 , where the key recovery
> service is required to store the user-requested key recovery configuration to
> all OM nodes (similar to ContainerBalancerConfiguration in Container Balancer
> HA). Previously, we did not contribute this to community since there is
> currently no valid use case (AFAIK all OM background services are stateless).
> However, it seems that S3 object lifecycle feature might require this
> feature. Therefore, we can contribute this to the community since there is
> now a valid use case.
> The main overview and purpose of the stateful service are:
> # Persist and replicate service configuration
> ** The interface is implemented in {{OMStatefulService}} and implemented by
> {{OMStatefulServiceStateManager}}
> ** OM uses {{SetServiceConfiguration}} request to persistently save the OM
> service framework
> *** OM request and response: {{OMSetServiceConfigurationRequest}} and
> {{OMSetServiceConfigurationResponse}}
> *** Table: statefulServiceConfigTable ({{{}Table<String, ByteString>{}}})
> # Notification mechanism when there are leader changes
> ** This is to ensure that only leader stateful service is running
> ** {{OMServiceManager#notifyStatusChanged}} and
> {{OMService#notifyStatusChanged}} to notify the stateful service whenever
> there is a change in leader
> ** {{OzoneManagerStateMachine}} Event APIs ({{{}notifyNotLeader{}}},
> {{{}notifyLeaderChanged{}}}, {{{}notifyTermIndexUpdated,
> notifyLeaderReady{}}}) will trigger the {{notifyStatusChanged}}
> *** The notification implementation is similar to {{SCMStateMachine}}
> *** {{notifyTermIndexUpdated}} is only done if there is a configuration
> change (i.e. OM transfer leadership, OM ratis ring update)
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]