-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CDAP-21096] Split Appfabric into stateless service and stateful processor #15773
[CDAP-21096] Split Appfabric into stateless service and stateful processor #15773
Conversation
6874823
to
75ec19d
Compare
75ec19d
to
b3e3e17
Compare
CredentialProviderService credentialProviderService, | ||
NamespaceCredentialProviderService namespaceCredentialProviderService, |
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.
why do we need CredentialProviderService
in processor?
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.
How will it work in this case if the processor service does not host any handlers but GcpWorkloadIdentityHttpHandler
runs in AppfabricService
?
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.
Not needed. Removed.
@@ -0,0 +1,216 @@ | |||
/* | |||
* Copyright © 2014-2020 Cask Data, Inc. |
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.
nit: 2024
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.
Updated
f88bc89
to
ce8bda2
Compare
@@ -0,0 +1,41 @@ | |||
/* | |||
* Copyright © 2014-2018 Cask Data, Inc. |
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.
nit: 2025
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.
Updated.
@@ -0,0 +1,195 @@ | |||
/* | |||
* Copyright © 2014-2024 Cask Data, Inc. |
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.
nit: 2025
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.
Updated.
227670b
to
510685e
Compare
cdap-app-fabric/src/main/java/io/cdap/cdap/internal/app/services/AppFabricServer.java
Show resolved
Hide resolved
NamespaceCredentialProviderService namespaceCredentialProviderService, | ||
ProvisioningService provisioningService, | ||
BootstrapService bootstrapService, | ||
SystemAppManagementService systemAppManagementService, |
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.
SystemAppManagementService#bootStrapSystemAppConfigDir is (a) slow (b) I am not sure what happens if we try to do it in parallel. Are there harm on keeping ApplicationLifecycleService/ProgramLifecycleService in the Processor as well?
private final ProgramStopSubscriberService programStopSubscriberService; | ||
private final RunRecordCorrectorService runRecordCorrectorService; | ||
private final RunDataTimeToLiveService runDataTimeToLiveService; | ||
private final ProgramRunStatusMonitorService programRunStatusMonitorService; | ||
private final RunRecordMonitorService runRecordCounterService; |
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.
This guy is not designed to run in multiple instances. It has internal tracker for "number of concurrent starts". Our counters will be wrong if we start it everywhere, e.g. removeRequest is mostly called by ProgramNotificationSubscriberServicem while new requests are added by the handler. We need to make this mechanism distributed. @masoud-io FYI
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.
As discussed, in this PR I have moved the HTTP handlers for program, app, workflow to processors.
They can be moved back to the Appfabric server after the issue due to in-memory cache is fixed. Created Jira for follow up PR: CDAP-21112 Move HTTP handler from Appfabric processor to server after fixing ProgramRuntimeService and RunRecordMonitorService
cdap-app-fabric/src/main/java/io/cdap/cdap/internal/app/services/AppFabricServer.java
Show resolved
Hide resolved
aed827e
to
e3a85e1
Compare
new AuditModule(), | ||
new AuthorizationModule(), | ||
new AuthorizationEnforcementModule().getMasterModule(), | ||
Modules.override(new AppFabricServiceRuntimeModule(cConf).getDistributedModules()) |
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.
Are you using same runtime module for Service and Processor? How does it decide what to bring up where?
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.
Yes, same module is used.
AppFabricServer
and AppFabricProcessorService
decide what to bring up for their service.
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 feel it's a bit too easy to mess up. We define both things and then if anyone refers to a thing with a different name, we get all the handlers up... It's probably not the biggest deal as Processor handlers won't be able to come up without necessary services, but it also introduces a hidden assumption.
May I ask you to add some explicit thing, e.g. add a parameter to AppFabricServiceRuntimeModule constructor (PROCESSOR_HANDLERS/SERVER_HANDLERS/BOTH_HANDLERS) and bind only the handlers this module is constructed for? This would make it explicit and ensures it's hard to mess it up.
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.
Since this will touch multiple files. I'm addressing this comment in a separate PR: #15799
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.
SG
6af62c9
to
eca1abb
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.
LGTM with one comment to address.
new AuditModule(), | ||
new AuthorizationModule(), | ||
new AuthorizationEnforcementModule().getMasterModule(), | ||
Modules.override(new AppFabricServiceRuntimeModule(cConf).getDistributedModules()) |
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 feel it's a bit too easy to mess up. We define both things and then if anyone refers to a thing with a different name, we get all the handlers up... It's probably not the biggest deal as Processor handlers won't be able to come up without necessary services, but it also introduces a hidden assumption.
May I ask you to add some explicit thing, e.g. add a parameter to AppFabricServiceRuntimeModule constructor (PROCESSOR_HANDLERS/SERVER_HANDLERS/BOTH_HANDLERS) and bind only the handlers this module is constructed for? This would make it explicit and ensures it's hard to mess it up.
bae34bc
to
0a2c5b8
Compare
…essor Fix RunRecordCorrectorService and AuditLogSubscriberService Fix RunRecordCorrectorService and AuditLogSubscriberService Add cdap system service for appfabric processor Move AppLifecycle, ProgramLifecycle and Workflow HTTP handlers to appfabric server Fix unit tests
0a2c5b8
to
7a71a52
Compare
Quality Gate failedFailed conditions |
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.
LGTM
new AuditModule(), | ||
new AuthorizationModule(), | ||
new AuthorizationEnforcementModule().getMasterModule(), | ||
Modules.override(new AppFabricServiceRuntimeModule(cConf).getDistributedModules()) |
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.
SG
Context
Make appfabric service stateless by splitting it into appfabric service to server HTTP requests and appfabric processor to run subscriber services and process message.
Change Description
AppFabricProcessorServiceMain
for appfabric processor.AppFabricProcessorService
which is used byAppFabricProcessorServiceMain
.AppFabricServer
and moved them toAppFabricProcessorService
.AppFabricServer
andAppFabricProcessorService
does not have any HTTP handlers.Verification
AppFabricProcessorServiceTest
to test Start and Stop (similar toAppFabricServerTest
).AppFabricProcessorServiceMain
as it does not host and HTTP handlers and runs only subscriber services.