{"action":"created","issue":{"url":"https://api.github.com/repos/SyncFree/antidote/issues/84","labels_url":"https://api.github.com/repos/SyncFree/antidote/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/SyncFree/antidote/issues/84/comments","events_url":"https://api.github.com/repos/SyncFree/antidote/issues/84/events","html_url":"https://github.com/SyncFree/antidote/issues/84","id":50205247,"number":84,"title":"Type Check","user":{"login":"aletomsic","id":2576194,"avatar_url":"https://avatars.githubusercontent.com/u/2576194?v=3","gravatar_id":"","url":"https://api.github.com/users/aletomsic","html_url":"https://github.com/aletomsic","followers_url":"https://api.github.com/users/aletomsic/followers","following_url":"https://api.github.com/users/aletomsic/following{/other_user}","gists_url":"https://api.github.com/users/aletomsic/gists{/gist_id}","starred_url":"https://api.github.com/users/aletomsic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aletomsic/subscriptions","organizations_url":"https://api.github.com/users/aletomsic/orgs","repos_url":"https://api.github.com/users/aletomsic/repos","events_url":"https://api.github.com/users/aletomsic/events{/privacy}","received_events_url":"https://api.github.com/users/aletomsic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2014-11-26T17:19:41Z","updated_at":"2015-09-14T18:20:37Z","closed_at":null,"body":"The way I see it, there are two possible directions to take from here.\r\n\r\nThe first one, which I think is the best in terms of performance and elegance, would be to perform the  type check as soon as a transaction starts. So, what this means is that the type check is the first task a tx coordinator should perform. So, the tx coord would call materialzer:type_check(Operations). The materialiser should check if for each op, the parameters sent are valid. The current implementation presents two problems for performing a complete check:\r\nit does not embed the type in the key, so at this stage we can not check that the operations also respect that the type is the same as the one stored for that key (if it exists).\r\nit does not include the type in update operations.\r\n\r\nThe second one (and easiest from the point the implementation is now) would be to perform the type check when generating the downstream operation. This presents the need of reading the key first in order to know its type and then see if the operation is supported and the parameters sent by the update are valid. Checking at this point would be expensive, as maybe many operations could have already generated its downstream. All the process of starting the coordinator, sending correct updates to partitions and then aborting the transaction will be done because of a wrong typed or bad parametrised operation.\r\n\r\nI could start by doing the second approach (which could be pretty easy) and then discuss about implementing the first one. I await your comments."},"comment":{"url":"https://api.github.com/repos/SyncFree/antidote/issues/comments/140165535","html_url":"https://github.com/SyncFree/antidote/issues/84#issuecomment-140165535","issue_url":"https://api.github.com/repos/SyncFree/antidote/issues/84","id":140165535,"user":{"login":"cmeiklejohn","id":44939,"avatar_url":"https://avatars.githubusercontent.com/u/44939?v=3","gravatar_id":"","url":"https://api.github.com/users/cmeiklejohn","html_url":"https://github.com/cmeiklejohn","followers_url":"https://api.github.com/users/cmeiklejohn/followers","following_url":"https://api.github.com/users/cmeiklejohn/following{/other_user}","gists_url":"https://api.github.com/users/cmeiklejohn/gists{/gist_id}","starred_url":"https://api.github.com/users/cmeiklejohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmeiklejohn/subscriptions","organizations_url":"https://api.github.com/users/cmeiklejohn/orgs","repos_url":"https://api.github.com/users/cmeiklejohn/repos","events_url":"https://api.github.com/users/cmeiklejohn/events{/privacy}","received_events_url":"https://api.github.com/users/cmeiklejohn/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T18:20:37Z","updated_at":"2015-09-14T18:20:37Z","body":"Ah, alright.  Do we need to worry about concurrent transactions over the same key with different data types, given they won't merge correctly?"}}