Skip to content
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

Feature: [metasrv]: add API watch #4393

Closed
1 of 3 tasks
drmingdrmer opened this issue Mar 11, 2022 · 4 comments
Closed
1 of 3 tasks

Feature: [metasrv]: add API watch #4393

drmingdrmer opened this issue Mar 11, 2022 · 4 comments
Assignees
Labels
A-meta Area: databend meta serive C-feature Category: feature
Milestone

Comments

@drmingdrmer
Copy link
Member

drmingdrmer commented Mar 11, 2022

Summary

A client requests metasrv to create a stream to receive events about a key.

A good reference of watching API is: etcd-v3 watch API: https://etcd.io/docs/v3.2/learning/api/#watch-api

@drmingdrmer drmingdrmer added the C-feature Category: feature label Mar 11, 2022
@drmingdrmer
Copy link
Member Author

TODO: split into sub issues

@flaneur2020
Copy link
Member

flaneur2020 commented Mar 24, 2022

can we take advantage of the Watch API to make a distributed lock? maybe there are cases like a distributed task (https://docs.snowflake.com/en/sql-reference/sql/create-task.html), each task has to be executed ONCE in a query instance, avoiding two query instances get executed in the same time. thus the tasks can be protected by a distributed lock.

@drmingdrmer
Copy link
Member Author

Yes, a lock can be implemented with watch.

But the execute-exactly-once semantic can not be implemented with just a lock. You still need some stateful service to store if the task has already been executed.

@BohuTANG
Copy link
Member

This issue seems can be closed after #4779 @drmingdrmer

@Xuanwo Xuanwo added this to the v0.8 milestone May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: databend meta serive C-feature Category: feature
Projects
None yet
Development

No branches or pull requests

5 participants