当前位置:网站首页>Introduction to asynchronous task capability of function calculation - task trigger de duplication
Introduction to asynchronous task capability of function calculation - task trigger de duplication
2022-07-04 03:47:00 【InfoQ】
Preface
Talking about task de duplication

- At-Most-Once: Ensure that the message is delivered at most once . When the network partition appears 、 When system components are down , Message loss may occur ;
- At-Least-Once: Ensure that the message is delivered at least once . The messaging link supports error retry , The message retransmission mechanism is used to ensure that the downstream must receive the upstream message , But in the case of downtime or network partition , May cause the same message to be delivered multiple times .
- Exactly-Once Mechanism can ensure that the message is sent exactly once , Accurate once does not mean that there is no retransmission in the case of downtime or network partition , Instead, retransmission does not change the state of the receiver , It is the same as the result of one transmission . In actual production , It often depends on retransmission mechanism & The receiver removes the duplicate ( idempotent ) To achieve Exactly Once.
- System side support : Task scheduling system itself failover It does not affect the correctness and uniqueness of message delivery ;
- Provide users with a mechanism , It can be combined with business scenarios , Trigger the whole business logic + Perform to heavy .
Function to calculate the implementation background of asynchronous task trigger de duplication

- System side support : Steps in 2.1 - 3.1 in , Of any intermediate process Failover Only one step can be triggered 3.2 Implementation , That is, the user instance will be scheduled to run only once ;
- User side application level de duplication capability : It can support users to repeatedly execute steps 1, But it will only be triggered once step 3.2 Implementation .
The system side is upgraded gracefully & Failover When the task distribution to re guarantee
- The uniqueness of consumption : Each message in each queue is consumed , Will enter “ Invisible mode ”. In this mode , This message is not available to other consumers ;
- The actual consumer of each message needs to update the invisible time of the pattern in real time ; When the consumer is finished , Delete the message to be displayed .

- Calculate the scheduling strategy of the load balancing module according to the function , Listen to the queue for which you are responsible ;
- When a message appears in the queue , Pull the news , And maintain a state in memory : Until the message consumption is completed ( The user instance returns the result of function execution ) front , The visible time of continuously updating messages , Make sure that the message does not appear in the queue again ;
- When the task is completed , Show delete this message .

- If the message has not been delivered to the user's execution instance ( chart 2 Step in 3.1 ~ 3.2), So when this one Scheduler The responsible queue is used by others Scheduler After picking up , The message will reappear after the consumption visible period , therefore Scheduler 2 The message will be retrieved again , Do the following triggering .
- If the message has already started executing ( step 3.2), When the news is in Scheduler 2 After it reappears in , We rely on users VM Medium Agent Conduct status management . here Scheduler 2 The corresponding Agent Send execution request ; here Agent It is found that the message already exists in memory , Then the execution request will be ignored , And inform you of the execution results through this link Scheduler 2, And then complete Failover The recovery of .
User side business level distribution de duplication is realized
- The message did not reach the function computing system , The task was not submitted successfully ;
- The message has reached the function calculation and is queued , Task submitted successfully , However, due to the timeout, the user cannot know the information about the successful submission .
import fc "github.com/aliyun/fc-go-sdk"
func SubmitJob() {
invokeInput := fc.NewInvokeFunctionInput("ServiceName", "FunctionName")
invokeInput = invokeInput.WithAsyncInvocation().WithStatefulAsyncInvocationID("TaskUUID")
invokeOutput, err := fcClient.InvokeFunction(invokeInput)
...
}
summary
1 minute Serverless Build real websites at top speed


Click on
here
, Direct experience !
边栏推荐
- 1289_FreeRTOS中vTaskSuspend()接口实现分析
- [untitled]
- 渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密
- 渗透实战-SQLServer提权
- Smart subway | cloud computing injects wisdom into urban subway transportation
- GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
- Pandora IOT development board learning (HAL Library) - Experiment 6 independent watchdog experiment (learning notes)
- 函数计算异步任务能力介绍 - 任务触发去重
- 如何有效远程办公之我见 | 社区征文
- Don't disagree, this is the most powerful "language" of the Internet
猜你喜欢
![[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)](/img/e9/818bdfeae766dca7d2318b52b4424d.jpg)
[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)

AAAI2022 | Word Embeddings via Causal Inference: Gender Bias Reducing and Semantic Information Preserving

Mitsubishi M70 macro variable reading Mitsubishi M80 public variable acquisition Mitsubishi CNC variable reading acquisition Mitsubishi CNC remote tool compensation Mitsubishi machine tool online tool

No clue about the data analysis report? After reading this introduction of smartbi, you will understand!

If you have just joined a new company, don't be fired because of your mistakes

Cache general management class + cache httpcontext Current. Cache and httpruntime Differences between caches

Third party login initial version

MySQL one master multiple slaves + linear replication

JVM family -- heap analysis

ctf-pikachu-CSRF
随机推荐
SQL statement strengthening exercise (MySQL 8.0 as an example)
微信公众号网页授权
MySQL backup notes
2022 registration examination for safety production management personnel of fireworks and firecracker production units and examination skills for safety production management personnel of fireworks an
Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
Redis notes (I) Linux installation process of redis
[database I] database overview, common commands, view the table structure of 'demo data', simple query, condition query, sorting data, data processing function (single row processing function), groupi
ctf-pikachu-CSRF
PID of sunflower classic
How much does it cost to open a futures account in China? Where is it safe to open an account at present?
基于PHP的轻量企业销售管理系统
Object oriented -- encapsulation, inheritance, polymorphism
SQL語句加强練習(MySQL8.0為例)
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
【.NET+MQTT】.NET6 環境下實現MQTT通信,以及服務端、客戶端的雙邊消息訂閱與發布的代碼演示
Calculate the odd sum of 1~n (1~100 as an example)
warning: LF will be replaced by CRLF in XXXXXX
[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)
Explain AI accelerator in detail: why is this the golden age of AI accelerator?