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

SY-166 Key-Value State Forwarding & SY-1832 Go Client #1041

Open
wants to merge 30 commits into
base: rc
Choose a base branch
from

Conversation

emilbon99
Copy link
Contributor

@emilbon99 emilbon99 commented Jan 5, 2025

Issue Pull Request

Key Information

Description

Adds experimental support for multi-node clusters and provides an initial implementation of a Golang client.

Basic Readiness

  • I have performed a self-review of my code.
  • I have added relevant tests to cover the changes to CI.
  • I have added needed QA steps to the release candidate template that cover these changes.
  • I have updated in-code documentation to reflect the changes.
  • I have updated user-facing documentation to reflect the changes.

Backwards Compatibility

Data Structures

I have ensured that previous versions of stored data structures are properly migrated to new formats in the following projects:

  • Server
  • Console

API Changes

The following projects have backwards-compatible APIs:

  • Python Client
  • Server
  • TypeScript Client

Breaking Changes

Copy link
Contributor

@pjdotson pjdotson left a comment

Choose a reason for hiding this comment

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

Why are all of the protobuf generated files different now? And you also need to fix migration tests

x/go/kv/tx_test.go Show resolved Hide resolved
@synnaxlabs synnaxlabs deleted a comment from pjdotson Jan 11, 2025
@emilbon99
Copy link
Contributor Author

Why are all of the protobuf generated files different now? And you also need to fix migration tests

Because I made changes to the distribution layer RPCs, and re-generating with a new GPRC version causes all the PBs to change.

@emilbon99 emilbon99 requested a review from pjdotson January 11, 2025 23:08
@emilbon99 emilbon99 changed the title Sy 166 key value state forwarding SY-166 Key-Value State Forwarding & SY-1832 Go Client Jan 12, 2025
Copy link
Contributor

@pjdotson pjdotson left a comment

Choose a reason for hiding this comment

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

  1. Key-value state forwarding is good after comments are all addressed.
  2. For the Go client, there are a few issues:
  • Needs to be much much more documentation on public functions and data types. It is a public API after all.
  • Need to figure out how to publish it and add a deploy.go.yaml file to CI.
  • Need to add the go tests to the test.client.yaml CI file.
  • Website documentation should also include pages on reading and streaming data.

func Wrapf(err error, format string, args ...interface{}) error {
return errors.Wrapf(err, format, args...)
}

// CombineErrors returns err, or, if err is nil, otherErr. if err is non-nil, otherErr
// Combine returns err, or, if err is nil, otherErr. if err is non-nil, otherErr
// is attached as secondary error. See the documentation of `WithSecondaryError()` for
Copy link
Contributor

Choose a reason for hiding this comment

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

What is WithSecondaryError()? Should also be clear what happens when a) otherErr is
nil, err is not nil and b) both errors are nil

_, err = u.MiddlewareCollector.Exec(
freighter.Context{
Context: ctx,
Target: address.Newf("%s.%s", target, u.ServiceDesc.ServiceName),
Target: address.Newf("%s.%s", u.TargetPrefix+target, u.ServiceDesc.ServiceName),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to concatenate u.TargetPrefix and target if target was already
assigned a new value above?

freighter.Client,
freighter.Stream,
), err
return freighter.Context{
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good to make a parseClientContext function here.

@@ -109,7 +109,7 @@ const (
operationReceiverAddr = "opReceiver"
feedbackSenderAddr = "feedbackSender"
feedbackReceiverAddr = "feedbackReceiver"
recoveryTransformAddr = "recoveryTransform"
recoveryTransformAddr = "gossipRecoveryTransform"
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you rename this to a different pattern than all of the other consts

// To Open a Cluster, simply use cluster.Open.
package cluster

import (
"context"
"github.com/synnaxlabs/x/query"
Copy link
Contributor

Choose a reason for hiding this comment

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

Sort your import


This script can be run in conjuction with the `control_sequence.py` script to
demonstrate how a control sequence can be written in Synnax.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment does not make sense here (what is control_sequence.py). And did someone ask for us to show scheduled
commands in autosequences? If not I think we should either delete these two files or
move them into the dev folder until we have the actual implementation.

@@ -78,7 +79,11 @@ jobs:
working-directory: client/py

- name: Stop Main Server
run: docker stop synnax-main && docker rm synnax-main
if: always() && steps.start_main.outcome == 'success'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need the always() here; isn't steps.start_main.outcome == 'success'
enough? And how could we get here if that steps.start_main.outcome failed, wouldn't
this test exit at that point?

run: |
docker logs synnax-current
docker stop synnax-current
docker rm synnax-current
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comments as above

Copy link
Contributor

Choose a reason for hiding this comment

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

How are there no dependencies to this file? And you need to figure out how we are
going to publish the go client, and what other go packages we will be publishing because
of that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this could be moved to the x module

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.

2 participants