-
Notifications
You must be signed in to change notification settings - Fork 97
Evolve the TCK #316
Comments
Discussion Notes: CRDT The CrdtExample Service covers
with missing
How to implement Stateless KV |
@sleipnir this can be perhaps done similarly for the stateless model? wdyt? |
I bootstrapped myself a bit and started with the extension of the existing TCK implementing synthetic tests for the CRDT support. I currently use the existing WIP branch Cloudstate: |
Testing CRDT state replication within the TCK was surprisingly easy to do, at least to trigger an init message with a state applied by the proxy:
I'm sure there is perhaps a better way to force the proxy to replicate a CRDTs state, but this way, a full circle of an crashed and re-initialized user functions state is involved, which might be a use-case of its own. |
Beautiful work
Em segunda-feira, 18 de maio de 2020, Marcel Lanz <[email protected]>
escreveu:
… Testing CRDT state replication within the TCK was surprisingly easy to do,
at least to trigger an init message with a state applied by the proxy:
- Increment GCounter by X
- Get GCounter, but crash the entity intentionally
<https://gist.github.com/marcellanz/f9dfc651941e08666260ab21517f4137#file-tck_crdt_support_001-json-L145>
on reception on the user function side.
- Get GCounter, 2nd attempt => proxy delivers an init message +
initial state
<https://gist.github.com/marcellanz/f9dfc651941e08666260ab21517f4137#file-tck_crdt_support_001-json-L229>
- Return the GCounter and verify count == X
I'm sure there is perhaps a better way to force the proxy to replicate a
CRDTs state, but this way, a full circle of an crashed and re-initialized
user functions state is involved, which might be a use-case of its own.
sequence: tck_crdt_support_001.json – Verify GCounter
<https://gist.github.com/marcellanz/f9dfc651941e08666260ab21517f4137>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#316 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACTTZXBJP4L3SNXPTM7RDLRSGSJZANCNFSM4M7DLGGQ>
.
--
Adriano P. Santos
"O homem erudito é um descobridor de fatos que já existem - mas o homem
sábio é um criador de valores que não existem e que ele faz existir."
Albert Einstein
|
👍 great work |
I'm coming to the point where crdt-example.proto limits its use to TCK-verify a CRDT implementation. Also because I came to the conclusion that the CRDT TCK for sure has a completely synthetic part to capture all CRDT types. A useful synthetic service would not serve any other purpose than operate on CRDT types' API for verification. Anything with a practical use-case like the shopping cart would be supplementary. There are uses for
Two a bit older and Options
I think I'd probably go for the latter option and having the @pvlugter @viktorklang @jroper wdyt? |
I vote for creating a new service as well. The original thought of the
shopping-cart being both a tck validator and an example was a good idea
initially but as features grow I feel the need for dedicated tck protos
increases.
--
Cheers,
√
|
Agree on adding a new service for synthetic tests. |
Thanks for voting :) I have a few points for the service design and the TCKs behaviour for the synthetic tests. Let me know wdyt, as the last point is a bit of work: New service 1:1 mapping of TCK-Service <> CRDT API Errors If we really like to decrement a GCounter, we would have a dedicated TCK rpc method where we instruct the support library to decrement the GCounter. And as said above, this would lead to an unusual typecast to call Force errors / Replicate state Test Coverage This applies especially for synthetic tests and might be different for a TCK use-case like the shoppingcart that we have right now for eventsourcing. There, the user support library proves to implement that usecase and can be used for demonstration purposes. This can be useful as one can replace the JS based shoppingcart implementation with any of the other ones implemented for the TCK, and the shopping cart demo would work. |
Hello everyone! |
I agree; every language support implementation should have their own unit tests covering, the TCK does not replace that. I'm sure, many language specific tests can't be done by the TCK and it was not my intent to propose that. |
Yes @marcellanz I understood that it was not your intention. Is that I believe that a mix of the two approaches (TCK, Coverage tests) should be desired. I say this because in your GCounter negative example I see this being tested in the support libraries because it is a very specific case and it is very related to the unfortunate path of a request. What I mean is that in addition to a good TCK we have to have a good specification on the expected behaviors, this must be defined clearly and publicly, so that the implementers have the ability to validate the idiosyncrasies of each language against the expected behaviors that were defined by the protocol. |
An excellent point! To have a relatively simple API with the TCK here, the 1:1 API mapping, helps so in the sense that implementing the user language part of the TCK service can be kept simple. But it does not help to understand how to implement a state model like CRDT. Things like what does "applying delta" state mean, or why and how does an implementation handle "changes", streamed commands and everything a The aspects of the CRDT state model and its accurate implementation will emerge, as soon as the TCK enforces the proxy to replicate and re-establish state to an entity, and then the expected behaviour or better said state is being verified or not. In this regard the TCK is a functional test of the state model, it does not describe how the user support library should implement that. |
… re-reading this and in short, this means we need a clear spec. What we have right now is not enough to describe what is accurately needed to implement the CRDT state model as an example. We have a Draft-PR for that #119 and a few discussions. One of my tasks of the Go CRDT support is to give input and feedback of how the spec can describe the state model better in this regard. |
@marcellanz I would go further and say that today we have no specifications. We have a technical contract defined in a series of .proto files but I don't think this is a formal protocol specification. It certainly wouldn't pass as a draft at the IETF or anything like that. What I mean is that .proto files don't explain behavior, they just indicate what are the inputs and outputs that implementers need to infer behaviors from. |
naahhh... I have to revise this a bit, the scala client and therefore java type will accept negative values to increment and will happily accept negative values, akkas ddata will remind us that this is not allowed though. A nice property of other languages not doing this kind of type conversions (Go).
|
@sleipnir very much true! I think priorities are not on this right now. Standards are a lot of work. Standard also presume interest and work to spread and having them proved by their usefulness. I think this is what we all work on right now, yes? :-) |
Yes, of course, it was just an observation and a warning that freedom also has a price. We have speed now that costs a little formal precision. But nothing that we cannot survive. |
I'm working on this the way proposed earlier. (don't judge me on my Scala code, I don't yet know what I'doing) WIP branches: |
I think this issue can be closed now as the TCK has been evolved into a model based TCK capturing mutiple state models now and is continuously expanded for new requirements and asditions to the Cloudstate protocol. |
Yes, was going to close after some more reorganisation in the TCK, and removing the shopping cart in particular, and using the model entities for proxy tests. But can be closed now. Tests for the different state models are added now. |
I'll defer to @pvlugter :) |
For tracking progress:
|
cool 👍 |
After a short Gitter discussion with @pvlugter and @sleipnir, I open this issue for discussion (attached is the gitter exchanges for context).
In short, the issue is to evolve the TCK so that a language support library implementation can be verified.
I think the topic is too broad to capture it in one issue and I propose to discuss it here and then create actionable issues out of it. I list here suggested topics and existing related issues.
Suggested Objectives
Related Issues
Related discussion (Gitter, May 11th)
The text was updated successfully, but these errors were encountered: