I made an observation while patching a LIST in C* and hope somebody could give me a hint if there is a rational explanation for this (ignoring if the use case is actually valid).
Assume a simple table with only one primary key and one column of type list.
CREATE TABLE ks.tbl(col_primary varchar,varchar_list list<varchar>,PRIMARY KEY(col_primary)) ;
Adding to that table one row with a list of some entries in the table.
INSERT INTO ks.tbl (col_primary,varchar_list) VALUES ('0815',['OlencUIkqqlVOFPiwsoEJM','JamilUOHIOXTWuGp','AbdulvZaeQDJOdu','GoldaGugnVNnbdSBpRpd','BrennaVvYuDyERsKvVW','FletcherpkkCYpEBket','DaytonglCSvswZQTEj','EdTUkTShUerYcfiSvCIH','LandenLTThnmlAAULJwdNwAma','IsabellelrDcMFHsyBGT','ArielOhIcLglehg','BellrtifChchjMZ','EmelieDdlViBlHUPQbxyUC']);
And finally updating the row with the following entry.
UPDATE ks.tbl SET varchar_list[1]=null,varchar_list[0]='MEGGCJOFic',varchar_list=varchar_list+['nwbaGsGbcd'] WHERE col_primary='0815' IF EXISTS;
The expected output for the list is (and most of the time actually is)
['MEGGCJOFic', 'AbdulvZaeQDJOdu', 'GoldaGugnVNnbdSBpRpd', 'BrennaVvYuDyERsKvVW', 'FletcherpkkCYpEBket', 'DaytonglCSvswZQTEj', 'EdTUkTShUerYcfiSvCIH', 'LandenLTThnmlAAULJwdNwAma', 'IsabellelrDcMFHsyBGT', 'ArielOhIcLglehg', 'BellrtifChchjMZ', 'EmelieDdlViBlHUPQbxyUC', 'nwbaGsGbcd']
Now applying this to a setup with two datacenters (US, EU) and using a consistency level of LOCAL_ONE and using one datacenter for updating and the other for reading a surprising result being returned is:
['MEGGCJOFic', 'nwbaGsGbcd']
That's exactly the two elements which have changed. After some time the list resolves itself and the expected content is being returned.
But how would it be possible to get into such an intermediate state as described above? The same happens btw. if using MAPS instead of LIST. I do know how the data is physically being layed out for collections in C* but how would it be possible that one cluster only contains the updates but not the original data?