-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update Forward Protocol Specification for zstd compression support #4758
Comments
I propose changes to the following two sections.
### CompressedPackedForward Mode
-It carries a series of events as a msgpack binary, compressed by gzip, on a single request. The supported compression algorithm is only gzip.
+It carries a series of events as a msgpack binary, compressed by gzip or zstd, on a single request.
-- `entries` is a gzipped binary chunk of `MessagePackEventStream`, which MAY be a concatenated binary of multiple gzip binary strings.
-- Client MUST send an option with `compressed` key with the value `gzip`.
-- Client MUST send a gzipped chunk as msgpack `bin` format.
+- `entries` is a gzip/zstd binary chunk of `MessagePackEventStream`, which MAY be a concatenated binary of multiple gzip/zstd binary strings.
+- Client MUST send an option with `compressed` key with the value `gzip` or `zstd`.
+- Client MUST send a gzip/zstd chunk as msgpack `bin` format.
- Server MUST accept `bin` format.
- Server MAY decompress and decode individual events on demand but MAY NOT do right after request arrival. It means it MAY costs less, compared to `Forward` mode, when decoding is not needed by any plugins.
https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1.5#option - Server MAY just ignore any options given.
- `size`: Clients MAY send the `size` option to show the number of event records in an entries by an integer as a value. Server can know the number of events without unpacking entries (especially for PackedForward and CompressedPackedForward mode).
- `chunk`: Clients MAY send the `chunk` option to confirm the server receives event records. The value is a string of Base64 representation of 128 bits `unique_id` which is an ID of a set of events.
-- `compressed`: Clients MUST send the `compressed` option with value `gzip` to tell servers that entries is `CompressedPackedForward`. Other values will be ignored.
+- `compressed`: Clients MUST send the `compressed` option with value `gzip` or `zstd` to tell servers that entries is `CompressedPackedForward`. Other values will be ignored.
```json
{"chunk": "p8n9gmxTQVC8/nh2wlKKeQ==", "size": 4097} |
Does this revision require a voting process? |
The changes suggested here looks good to me. |
If there are no objections, I would like to set it to v1.6 with the agreement of both Fluentd and Fluent Bit maintainers. @cosmo0920 |
LGTM |
This would be good:
However, I have a question for these sentences. Currently, we're able to decompress compressed chunks one-by-one. So, in paper, we are also able to take turns to decompress gzip compressed chunks and zstd compressed chunks. |
@cosmo0920 are u pointing to the case where different sources send different type of compressed chunks? Incase of forward protocol the message itself has the compression type so the decompression happens wrt the metadata of the compressed chunk. |
Yes, different sources use the same in_forward case. This is surely occurred because Fluentd is able to be used as an aggregator which will collect the different Fluentd instances with pointing the same forward endpoint. So, probably we need to clarify on it even if the implementation already does. |
@cosmo0920 |
It’s not answered my question. My question is: Should we write down the current decompression behavior explicitly in the specification document of forward protocol? It's not covered for the actual implementation. This is because Fluent Protocol is shared between Fluentd and Fluent Bit. So, we need to describe the specification in the document instead of the implementations. |
got it @cosmo0920 . Previously there was a possibility that multiple sources could send either gzip compressed chunk or uncompressed one. If we consider uncompressed data also as a compression type then essentially the previous specification was good enough to express that 2 types were supported. Now we are just adding one more number to it so like idk if we really need to be explicit here |
Is your feature request related to a problem? Please describe.
The following PR supports zstd compression.
So, we need to update Forward Protocol Specification - CompressedPackedForward Mode.
Describe the solution you'd like
Update the following description and add
zstd
value tocompressed
option.Would that be Forward Protocol Specification v1.6?
Describe alternatives you've considered
Having no idea.
Additional context
No response
The text was updated successfully, but these errors were encountered: