-
Notifications
You must be signed in to change notification settings - Fork 6
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
storagenode,client: introduce LogStreamAppender #433
Closed
3 tasks done
Comments
@hungryjang, let's discuss an asynchronous client for "Local Order". |
ijsong
changed the title
client: introduce LocalOrderClient
storagenode,client: introduce LocalOrderClient
May 10, 2023
ijsong
added a commit
that referenced
this issue
May 16, 2023
This PR changes the Append RPC lifestyle from a unary to a bidirectional stream. However, it neither adds nor updates stream-styled Append. Therefore, this change is transparent for users. This is starting point to support streaming Append API, and LocalOrderClient mentioned on #433.
There are two ways to notify a result of an asynchronous call - callback and channel. We can refer to some examples:
Providing only blocking calls and leaving the asynchronous implementation call up to the user is also a good approach, but we will not consider it. Here are great talks:
|
ijsong
changed the title
storagenode,client: introduce LocalOrderClient
storagenode,client: introduce LogStreamAppender
May 18, 2023
ijsong
added a commit
that referenced
this issue
May 23, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. As a result of experimentations, this PR showed little overhead. This change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
May 23, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. As a result of experimentations, this PR showed little overhead. This change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
May 24, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. As a result of experimentations, this PR showed little overhead. This change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
May 24, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
May 25, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
This was
linked to
pull requests
May 25, 2023
ijsong
added a commit
that referenced
this issue
May 29, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
May 29, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
May 30, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
May 30, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
May 30, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This PR changes the Append RPC lifestyle from a unary to a bidirectional stream. However, it neither adds nor updates stream-styled Append. Therefore, this change is transparent for users. This is starting point to support streaming Append API, and LocalOrderClient mentioned on #433.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This PR changes the Append RPC lifestyle from a unary to a bidirectional stream. However, it neither adds nor updates stream-styled Append. Therefore, this change is transparent for users. This is starting point to support streaming Append API, and LocalOrderClient mentioned on #433.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This PR changes the Append RPC lifestyle from a unary to a bidirectional stream. However, it neither adds nor updates stream-styled Append. Therefore, this change is transparent for users. This is starting point to support streaming Append API, and LocalOrderClient mentioned on #433.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
Jun 1, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
Jun 4, 2023
This PR changes the Append RPC lifestyle from a unary to a bidirectional stream. However, it neither adds nor updates stream-styled Append. Therefore, this change is transparent for users. This is starting point to support streaming Append API, and LocalOrderClient mentioned on #433.
ijsong
added a commit
that referenced
this issue
Jun 4, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
Jun 4, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
Jun 4, 2023
### What this PR does This PR changes the Append RPC lifestyle from a unary to a bidirectional stream. However, it neither adds nor updates stream-styled Append. Therefore, this change is transparent for users. This is starting point to support streaming Append API, and LocalOrderClient mentioned on #433.
ijsong
added a commit
that referenced
this issue
Jun 4, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
Jun 4, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
Jun 7, 2023
This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
Jun 7, 2023
### What this PR does This patch changes the Append RPC handler to support pipelined requests and does not change the client's API. Therefore, users can use Append API transparently. Supporting pipelined requests can lead to overhead since it is necessary to have additional goroutines and concurrent queues. To lower additional overhead, this change uses [reader-biased mutex](https://github.com/puzpuzpuz/xsync#rbmutex) instead of built-in RWMutex to avoid shared lock contention. As a result of experimentations, this PR showed very little overhead. Furthermore, we can improve the existing Append API more efficiently [using a long-lived stream](https://grpc.io/docs/guides/performance/#general): the current implementation creates a new stream whenever calling Append API, which leads to unnecessary tasks such as RPC initiation. We can reuse long-lived streams by changing client API. See this issue at #458. ### Which issue(s) this PR resolves This PR implements server-side parts of LogStreamAppender mentioned in #433. It also can be used for pipelining generic Append RPC said in #441.
ijsong
added a commit
that referenced
this issue
Jun 7, 2023
This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. Resolves #433.
ijsong
added a commit
that referenced
this issue
Jun 7, 2023
### What this PR does This PR adds LogStreamAppender to the client, and it is a client to append asynchronously only a particular log stream. ### Which issue(s) this PR resolves Resolves #433
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Varlog is a storage system for logs that is both ordered and distributed. To ensure that the storage system is scalable and tolerant to faults, the storage layer in Varlog is partitioned. These partitions are called LogStreams, and each LogStream orders log entries sequentially in what we call "Local Order". The log entries are also arranged sequentially across LogStreams in what we call "Global Order".
Certain applications, such as Kov (Kafka on Varlog), only require "Local Order" and can use the Varlog client. However, this client has some limitations, such as blocking operations until prior results are received and only providing synchronous patterns. Supporting asynchronous Append operations is not trivial. See #441.
To address this, a new asynchronous client has been proposed that supports only Append operation to a single log stream - LogStreamAppender.
Design
The LogStreamAppender operates with a single LogStream. It can append new log entries only to a specific LogStream. Although it only works with specific LogStream, it can take advantage of asynchronous patterns, hence, does not block user codes.
NewLogStreamAppender returns a new client for LogStreamAppender, which provides asynchronous Append APIs for the particular log stream specified by the argument tpid and lsid.
The result client offers only Append to the specific log stream. When the client triggers multiple operations in a goroutine, the appended log entries are kept in the operation order.
Different clients connected to the same log stream can not follow the order. Even if two clients, c1 and c2, connected to the same log stream, call Append interleaved in a single goroutine, it cannot guarantee "Local Order" in two clients' operations.
Challenges
These are the challenges we need to address:
Tasks
The text was updated successfully, but these errors were encountered: