Skip to content

Refactor ETL threading to support consolidateOnShutdown on multiple dataStores for a PV #361

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

Closed
wants to merge 10 commits into from

Conversation

slacmshankar
Copy link
Collaborator

This is a semi-largish change. While the unit tests seem to be passing, this needs to be tested in a production environment for impact. I plan to test this Jul-Aug during our downtime and hope for an official release in Sep.

…ches in DefaultConfigService.

Instead try using Hz predicates ( which seemed to work well with GetDataAtTime )
This is a precursor to having reassignAppliance functionality.
Some of the BPLs had to change as we need to set the typeinfo first before registering to the appliance
Show details based on StoragePlugin name rather than position in the array.
This is needed for supporting varying datastore arrays where some PVS have
STS -> MTS -> LTS
and other may have
STS -> SSD -> MTS -> LTS.

Change some class names and variable names to reflect that ETL happens in stages.
For example, ETLStage and ETLStageDetails

Also some minor UI changes
We added support for this using Named Variables
Move away from one thread per lifetime to
using virtual threads and sequencing
one ETL stage after another.
This should help support consolidateOnShutdown
on multiple datastores. For example, we should now
be able to support consolidateOnShutdown on both the
STS and MTS.
Let's see if the distributed query functions just as fast
}
logger.debug("Running ETL for {} with stages {}", pvName, etlStages.getStages().size());
try(ScheduledThreadPoolExecutor scheduleWorker = new ScheduledThreadPoolExecutor(1)) {
try(ExecutorService theWorker = Executors.newVirtualThreadPerTaskExecutor()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to cancel these? I had a request for more finegrained control on the ETL, i.e. to trigger early or halt for some time.
Would also be useful for unit testing maybe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: Is there a way to cancel these?
We have a Future; so we should be able to cancel if we hang on to the future in the ETLStage/ETLStages. Should be safe to cancel mid-way I think.

Re: to trigger early
The consolidate BPL has this in some sense so we may just need to use this and maybe fix the nextETLStart. Or maybe just manipulate the nextETLStart

Re: halt for some time
Yeah; this might be useful. On a global scale, we can do this using named variables ( similar to what we do for retrieval ). On a per PV scale, we can maybe accomplish this by manipulating the nextETLStart

Let me know if this is not what you meant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to make sure that pause/resume/connect/disconnect are still working after a component restart etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked pause/resume/connect/disconnect are still working after a component restart

Copy link
Collaborator Author

@slacmshankar slacmshankar Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything more needed here? Don't mind pushing these largish changes onto a 2.1 branch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope looks good to me.

@slacmshankar slacmshankar marked this pull request as draft June 9, 2025 21:52
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)
B Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@slacmshankar slacmshankar marked this pull request as ready for review June 17, 2025 18:00
@slacmshankar
Copy link
Collaborator Author

Will resend this pull request once I merge properly. The conflicts are not complex but I have my repos in a messy state and I may need to redo this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants