bsc-dd / hecuba

Apache License 2.0
5 stars 5 forks source link

Inconsistency when writing to StorageDict #195

Closed adrianespejo closed 5 years ago

adrianespejo commented 5 years ago
In [4]: class URCA(StorageDict):
   ...:     '''
   ...:     @TypeSpec <<int>,int>
   ...:     '''
   ...:     

In [5]: a=URCA('hola.ciao')

In [6]: for i in range(10):
   ...:     for j in range (10):
   ...:         a[i]=j
   ...:         

In [7]: a
Out[7]: {0: 8, 1: 6, 2: 8, 3: 8, 4: 8, 5: 9, 6: 9, 7: 9, 8: 9, 9: 9}

a should be {0: 9, 1: 9, 2: 9, 3: 9, 4: 9, 5: 9, 6: 9, 7: 9, 8: 9, 9: 9}
polsm91 commented 5 years ago

@cugni This is related to overriding the same value (a[i]). We use an asynchronous, parallel, writing strategy without timestamps. Therefore, we can't enforce "last write wins" and we should change the current implementation.

Actually, we need to change the write strategy to solve #122

cugni commented 5 years ago

relates to #234 and #233

polsm91 commented 5 years ago

Fixed by #233