Skip to content

[Feature-6471]Cache Process definition in master#6485

Merged
zhuangchong merged 16 commits intoapache:devfrom
lenboo:dev-6471
Oct 11, 2021
Merged

[Feature-6471]Cache Process definition in master#6485
zhuangchong merged 16 commits intoapache:devfrom
lenboo:dev-6471

Conversation

@lenboo
Copy link
Contributor

@lenboo lenboo commented Oct 10, 2021

close #6471 cache process definition in master

Copy link
Member

@zhongjiajie zhongjiajie left a comment

Choose a reason for hiding this comment

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

Add some of minor suggestion

Copy link
Member

@zhongjiajie zhongjiajie left a comment

Choose a reason for hiding this comment

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

Seem not CI failed, but we have typo in our database filed

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2021

Codecov Report

Merging #6485 (f8c765a) into dev (e091801) will increase coverage by 0.02%.
The diff coverage is 55.22%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #6485      +/-   ##
============================================
+ Coverage     38.62%   38.64%   +0.02%     
- Complexity     3206     3211       +5     
============================================
  Files           645      645              
  Lines         25735    25757      +22     
  Branches       2788     2792       +4     
============================================
+ Hits           9940     9955      +15     
- Misses        14881    14890       +9     
+ Partials        914      912       -2     
Impacted Files Coverage Δ
...inscheduler/server/master/config/MasterConfig.java 15.38% <0.00%> (-1.29%) ⬇️
...r/server/master/runner/MasterSchedulerService.java 0.00% <0.00%> (ø)
...inscheduler/service/quartz/ProcessScheduleJob.java 0.00% <0.00%> (ø)
...rg/apache/dolphinscheduler/dao/entity/Command.java 43.79% <40.00%> (-0.11%) ⬇️
...cheduler/api/service/impl/ExecutorServiceImpl.java 48.72% <55.55%> (+0.46%) ⬆️
...lphinscheduler/service/process/ProcessService.java 37.22% <74.28%> (-1.02%) ⬇️
...rver/master/processor/queue/TaskResponseEvent.java 100.00% <0.00%> (+6.45%) ⬆️
...er/master/processor/queue/TaskResponseService.java 55.29% <0.00%> (+15.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e091801...f8c765a. Read the comment docs.

#master.task.commit.interval=1000

# master cache process definition
#master.cache.process.definition=true
Copy link
Member

Choose a reason for hiding this comment

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

Should we turn on cache by default

Suggested change
#master.cache.process.definition=true
master.cache.process.definition=true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have already set the default value in the class MasterConfig.

Copy link
Member

Choose a reason for hiding this comment

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

For this situation, I think we better add comment in L42 to desc # master cache process definition, default true make it more clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right.
thank you for your suggestion.

this.masterConfig.getMasterExecThreads() - activeCount, command);
command,
processDefinitionCacheMaps);
if (!masterConfig.getMasterCacheProcessDefinition()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it better to manage processDefinition cache by a unified manager?

Map<String, String> cmdParam = JSONUtils.toMap(command.getCommandParam());

ProcessDefinition processDefinition = getProcessDefinitionByCommand(command.getProcessDefinitionCode(), cmdParam);
String key = String.format("%d-%d", command.getProcessDefinitionCode(), command.getProcessDefinitionVersion());
Copy link
Contributor

Choose a reason for hiding this comment

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

Any other else? Or it just use for constructProcessInstance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Is it better to manage processDefinition cache by a unified manager?
    yes, you are right, we can use a unified cache manager. we need to optimize this caching method next.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any other else? Or it just use for constructProcessInstance?

maybe the task definitions can also be cached
and a clean-up mechanism can also be added to the cache queue, eg: clean cache queue once a day?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

48.5% 48.5% Coverage
0.0% 0.0% Duplication

Copy link
Member

@zhongjiajie zhongjiajie left a comment

Choose a reason for hiding this comment

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

LGTM now

@zhuangchong zhuangchong merged commit db04a5b into apache:dev Oct 11, 2021
lenboo added a commit to lenboo/dolphinscheduler that referenced this pull request Oct 12, 2021
* feature-6471 Cache Process definition in master
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.

[Feature][Master] Cache Process definition in master

6 participants