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

Init TSO service and start service loop #6008

Merged
merged 5 commits into from
Feb 27, 2023

Commits on Feb 27, 2023

  1. Init TSO service and start servicce loop

    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Add Participant which is non-embedded-etcd version of Member.
    Rename Member to the EmbeddedEtcdMember.
    Add Member interface which defines the behavior of a member particpating in an election regardless of concrete mechanism behind.
    Decouple embedded etcd from TSO AllocatorManager, GlobalTSOAllocator and LocalTSOAllocator.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Refactor the GRPC and HTTP Server start logic.
    
    It refers to DGraph https://github.com/binshi-bing/dgraph/blob/cbec2309413a9b17d407b3417300f719381b36d7/dgraph/cmd/zero/run.go#L318-L319 and cmux example https://github.com/soheilhy/cmux/blob/5ec6847320e53b5fee0ab9a4757b56625a946c85/example/example_test.go#L108.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Add TSO primary/leader election loop and adjust config with default values.
    
    Changes:
    1. Add TSO primary/leader election loop
    2. Add tso.Config.Adjust() to adjust config with default values if they're not in configuration file or passed from commandline.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Handle feedbacks
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Update defaultListenAddr = 127.0.0.1:3379 and defaultHTTPGracefulShutdownTimeout = 5 * time.Second
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    rebase master
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Handle feedbacks
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Update the key for keyspace group primary election (e.g., /pd/microservice/tso/keyspace-group-00000/primary)
    
    The entire key is in the format of "/pd/microservice/tso/keyspace-group-XXXXX/primary" in which XXXXX is 5 digits integer with leading zeros.
    For example, the key for keyspace group 0 primary election is "/pd/microservice/tso/keyspace-group-00000/primary"
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Update the format of the key for keyspace group primary electio to "/pd/<cluster-id>/microservice/tso/keyspace-group-XXXXX/primary".
    For now we use 0 as the default cluster id.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Refactor log when grpc/http server stops serving
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Handle feedback -- move Member interface to pkg/tso to keep the just-right visibility
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Add unique name/id for Compaign Election and fix a bug in Primary Election loop.
    
    Passed HA/Failure test on local box.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Set cluster id to default value 0 for now to satisfy the cluster id verification between the client and the server side.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    
    Add TSO Server Start/Stop Unittest.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    binshi-bing committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    3c20012 View commit details
    Browse the repository at this point in the history
  2. Resolve conflict when rebase master; implement tso.Server.GetPrimary()

    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    binshi-bing committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    0920456 View commit details
    Browse the repository at this point in the history
  3. Handle feedback

    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    binshi-bing committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    88376a4 View commit details
    Browse the repository at this point in the history
  4. move NewTSOServiceCommand back to main

    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    binshi-bing committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    e6cd0a8 View commit details
    Browse the repository at this point in the history
  5. remove tso.Server().GetConfigAny() which was added by the other peopl…

    …e's commit by mistake.
    
    Signed-off-by: Bin Shi <binshi.bing@gmail.com>
    binshi-bing committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    d140827 View commit details
    Browse the repository at this point in the history