[
https://issues.apache.org/jira/browse/IGNITE-20375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pavel Tupitsyn updated IGNITE-20375:
------------------------------------
Description:
Ignite 3.x client protocol uses MsgPack for message serialization. In some
places we use *packArrayHeader* incorrectly, for example,
[ClientCompute.packJob|https://github.com/apache/ignite-3/blob/fa8d626f57e3497289c0aaa1bfa8efd19f1042f7/modules/client/src/main/java/org/apache/ignite/internal/client/compute/ClientCompute.java#L330]:
{code:java}
w.packArrayHeader(units.size());
for (DeploymentUnit unit : units) {
w.packString(unit.name());
w.packString(unit.version().render());
}
{code}
We pack 2N items for an array of size N, and in some cases those items can be
of different type, which breaks the rules of MsgPack protocol.
This creates issues with some MsgPack implemetations, such as the one used in
C++ client (msgpack-c):
* Exactly N items must be present
* Entire array is deserialized at once (can't read large arrays one by one)
Proposal: don't use *packArrayHeader* at all, replace with *packInt*, which
allows more flexibility.
was:
Ignite 3.x client protocol uses MsgPack for message serialization. In some
places we use *packArrayHeader* incorrectly, for example,
[ClientCompute.packJob|https://github.com/apache/ignite-3/blob/fa8d626f57e3497289c0aaa1bfa8efd19f1042f7/modules/client/src/main/java/org/apache/ignite/internal/client/compute/ClientCompute.java#L330]:
{code:java}
w.packArrayHeader(units.size());
for (DeploymentUnit unit : units) {
w.packString(unit.name());
w.packString(unit.version().render());
}
{code}
We pack 2N items for an array of size N, and in some cases those items can be
of different type, which breaks the rules of MsgPack protocol.
This creates issues with some MsgPack implemetations, such as the one used in
C++ client (msgpack-c).
> Thin 3.0: Review packArrayHeader usage
> --------------------------------------
>
> Key: IGNITE-20375
> URL: https://issues.apache.org/jira/browse/IGNITE-20375
> Project: Ignite
> Issue Type: Improvement
> Components: thin client
> Affects Versions: 3.0.0-beta1
> Reporter: Pavel Tupitsyn
> Assignee: Pavel Tupitsyn
> Priority: Major
> Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>
> Ignite 3.x client protocol uses MsgPack for message serialization. In some
> places we use *packArrayHeader* incorrectly, for example,
> [ClientCompute.packJob|https://github.com/apache/ignite-3/blob/fa8d626f57e3497289c0aaa1bfa8efd19f1042f7/modules/client/src/main/java/org/apache/ignite/internal/client/compute/ClientCompute.java#L330]:
> {code:java}
> w.packArrayHeader(units.size());
> for (DeploymentUnit unit : units) {
> w.packString(unit.name());
> w.packString(unit.version().render());
> }
> {code}
> We pack 2N items for an array of size N, and in some cases those items can be
> of different type, which breaks the rules of MsgPack protocol.
> This creates issues with some MsgPack implemetations, such as the one used in
> C++ client (msgpack-c):
> * Exactly N items must be present
> * Entire array is deserialized at once (can't read large arrays one by one)
> Proposal: don't use *packArrayHeader* at all, replace with *packInt*, which
> allows more flexibility.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)