Giter Site home page Giter Site logo

Comments (3)

terrymanu avatar terrymanu commented on May 8, 2024

由于各个任务是分布式的,由于各个服务器有时间差,无法保证主节点一定最先执行。
如果从节点先于主节点执行,会发生init方法还没有执行的问题,从节点作业就运行的问题。
改为主节点不执行,其他节点阻塞,有2个问题:

  1. 吞吐量下降
  2. 如何判断主节点在本次作业中是否执行过。因为作业循环往复,本次执行结束和下次执行开始在分布式环境下无法区分

欢迎讨论,
如果可以有方法实现让主节点一定优先于从节点执行的方法,这个issue才可以继续做。

from shardingsphere-elasticjob.

joock avatar joock commented on May 8, 2024

1、每个任务完成之后写zk,分片任务写多个节点,leader监听父节点,所有任务都完成则设置任务完成的标记位。
2‘、在后置任务中指定前置任务,后置任务到达执行时间的时候,先检测前置任务是否执行完毕,如果没有执行完毕,则等待一定的时间。
2‘’,在后置任务中指定前置任务,前置任务完成之后,发送通知驱动后置任务启动。
2‘’‘,在后置任务中制定前置任务,后置任务监听前置任务创建的zk节点,前置任务设置任务完成的标记位时,后置任务的watcher收到通知,后置任务启动。
@terrymanu 不知以上方案是否可行,请百忙中参考一下~ :)
刚开始读代码~不知道最近能否实现以上方案,并pull request~

from shardingsphere-elasticjob.

gl2001wl avatar gl2001wl commented on May 8, 2024

任务依赖,之前使用quartz自己的listener实现的,前置自动触发后置的

from shardingsphere-elasticjob.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.