New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update static list element >= 2.0.3 - Attempted to set an element on a list which is null #3703

Closed
rlk833 opened this Issue Aug 20, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@rlk833

rlk833 commented Aug 20, 2018

This is Scylla's bug tracker, to be used for reporting bugs only.
If you have a question about Scylla, and not a bug, please ask it in
our mailing-list at scylladb-dev@googlegroups.com or in our slack channel.

  • I have read the disclaimer above, and I am reporting a suspected malfunction in Scylla.

Installation details
Scylla version (or git commit hash): 2.2.0 (Scylla Docker tag: latest)
Cluster size: Docker image
OS (RHEL/CentOS/Ubuntu/AWS AMI): Docker image

I was running in 1.7.3 with no problems. When I migrated up to 2.0.3 I ran into this problem. It is preventing me from moving our production database to a new Compose cluster. Compose is currently at 2.0.3 and they don't support a new database at a lower level. We need to move to the new cluster


I simplified it to:
Schema:

create table testlist (id text, liststatic list<text> static, id2 text, edata text, elist list<text>, primary key(id, id2));
insert into testlist (id, liststatic, id2, edata, elist) values('a', ['b'], 'c', 'd', ['e']);

I execute in cqlsh (Note: exact same failures occurs using gocql driver so not driver specific)

Contacting localhost:9042
Default keyspace for this branch is 'catalog'
Connected to  at localhost:9042.
[cqlsh 5.0.1 | Cassandra 3.0.8 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
cqlsh:catalog> select * from testlist;

 id | id2 | liststatic | edata | elist
----+-----+------------+-------+-------
  a |   c |      ['b'] |     d | ['e']

(1 rows)
cqlsh:catalog> UPDATE testlist SET edata='uptext', liststatic[0]='up' WHERE id='a' AND id2='c';
InvalidRequest: Error from server: code=2200 [Invalid query] message="Attempted to set an element on a list which is null"

We are blocked from moving at this time.

Thank you, Rich

@duarten duarten self-assigned this Aug 20, 2018

@duarten

This comment has been minimized.

Member

duarten commented Aug 20, 2018

The regression was introduced in 9e88b60, which broke the lookup for prefetched values of lists when a clustering key is specified. Patch is on the mailing list.

@rlk833

This comment has been minimized.

rlk833 commented Aug 20, 2018

@duarten Thanks. This will get into the next fix releases, right? Is there a schedule for these? It will go into which releases?

@duarten

This comment has been minimized.

Member

duarten commented Aug 20, 2018

It will at least get into 2.3, which is now in RC. @tzach will know best though, including the schedule.

duarten added a commit to duarten/scylla that referenced this issue Aug 21, 2018

tests/cql_query_test: Test multi-cell static list updates with ckeys
Refs scylladb#3703

Signed-off-by: Duarte Nunes <duarte@scylladb.com>

tgrabiec added a commit that referenced this issue Aug 21, 2018

Merge 'Fix multi-cell static list updates in the presence of ckeys' f…
…rom Duarte

Fixes a regression introduced in
9e88b60, which broke the lookup for
prefetched values of lists when a clustering key is specified.

This is the code that was removed from some list operations:

 std::experimental::optional<clustering_key> row_key;
 if (!column.is_static()) {
   row_key = clustering_key::from_clustering_prefix(*params._schema, prefix);
 }
 ...
 auto&& existing_list = params.get_prefetched_list(m.key().view(), row_key, column);

Put it back, in the form of common code in the update_parameters class.

Fixes #3703

* https://github.com/duarten/scylla cql-list-fixes/v1:
  tests/cql_query_test: Test multi-cell static list updates with ckeys
  cql3/lists: Fix multi-cell static list updates in the presence of ckeys
  keys: Add factory for an empty clustering_key_prefix_view

duarten added a commit that referenced this issue Aug 21, 2018

Merge 'Fix multi-cell static list updates in the presence of ckeys' f…
…rom Duarte

Fixes a regression introduced in
9e88b60, which broke the lookup for
prefetched values of lists when a clustering key is specified.

This is the code that was removed from some list operations:

 std::experimental::optional<clustering_key> row_key;
 if (!column.is_static()) {
   row_key = clustering_key::from_clustering_prefix(*params._schema, prefix);
 }
 ...
 auto&& existing_list = params.get_prefetched_list(m.key().view(), row_key, column);

Put it back, in the form of common code in the update_parameters class.

Fixes #3703

* https://github.com/duarten/scylla cql-list-fixes/v1:
  tests/cql_query_test: Test multi-cell static list updates with ckeys
  cql3/lists: Fix multi-cell static list updates in the presence of ckeys
  keys: Add factory for an empty clustering_key_prefix_view

(cherry picked from commit 6937cc2)

duarten added a commit that referenced this issue Aug 21, 2018

Merge 'Fix multi-cell static list updates in the presence of ckeys' f…
…rom Duarte

Fixes a regression introduced in
9e88b60, which broke the lookup for
prefetched values of lists when a clustering key is specified.

This is the code that was removed from some list operations:

 std::experimental::optional<clustering_key> row_key;
 if (!column.is_static()) {
   row_key = clustering_key::from_clustering_prefix(*params._schema, prefix);
 }
 ...
 auto&& existing_list = params.get_prefetched_list(m.key().view(), row_key, column);

Put it back, in the form of common code in the update_parameters class.

Fixes #3703

* https://github.com/duarten/scylla cql-list-fixes/v1:
  tests/cql_query_test: Test multi-cell static list updates with ckeys
  cql3/lists: Fix multi-cell static list updates in the presence of ckeys
  keys: Add factory for an empty clustering_key_prefix_view

(cherry picked from commit 6937cc2)

duarten added a commit that referenced this issue Aug 21, 2018

Merge 'Fix multi-cell static list updates in the presence of ckeys' f…
…rom Duarte

Fixes a regression introduced in
9e88b60, which broke the lookup for
prefetched values of lists when a clustering key is specified.

This is the code that was removed from some list operations:

 std::experimental::optional<clustering_key> row_key;
 if (!column.is_static()) {
   row_key = clustering_key::from_clustering_prefix(*params._schema, prefix);
 }
 ...
 auto&& existing_list = params.get_prefetched_list(m.key().view(), row_key, column);

Put it back, in the form of common code in the update_parameters class.

Fixes #3703

* https://github.com/duarten/scylla cql-list-fixes/v1:
  tests/cql_query_test: Test multi-cell static list updates with ckeys
  cql3/lists: Fix multi-cell static list updates in the presence of ckeys
  keys: Add factory for an empty clustering_key_prefix_view

(cherry picked from commit 6937cc2)

duarten added a commit that referenced this issue Aug 21, 2018

Merge 'Fix multi-cell static list updates in the presence of ckeys' f…
…rom Duarte

Fixes a regression introduced in
9e88b60, which broke the lookup for
prefetched values of lists when a clustering key is specified.

This is the code that was removed from some list operations:

 std::experimental::optional<clustering_key> row_key;
 if (!column.is_static()) {
   row_key = clustering_key::from_clustering_prefix(*params._schema, prefix);
 }
 ...
 auto&& existing_list = params.get_prefetched_list(m.key().view(), row_key, column);

Put it back, in the form of common code in the update_parameters class.

Fixes #3703

* https://github.com/duarten/scylla cql-list-fixes/v1:
  tests/cql_query_test: Test multi-cell static list updates with ckeys
  cql3/lists: Fix multi-cell static list updates in the presence of ckeys
  keys: Add factory for an empty clustering_key_prefix_view

(cherry picked from commit 6937cc2)
@rlk833

This comment has been minimized.

rlk833 commented Sep 4, 2018

@tzach Hi, do you have a preliminary release plan on when 2.1.x or 2.2.x with this fix will come out? Currently, because of this bug, I can't do a disaster recovery. My DB is at level 1.7.5 in Compose, and Compose doesn't support restore a backup at 1.7.5. They are currently supporting 2.0.3. I think I could convince them to go to 2.1 or 2.2, but I can't convince them to allow a restore at 1.7.5. Also, my company, IBM, is asking to do a disaster recovery test real soon, which includes restore from backup. Thanks, Rich Kulp

@dorlaor

This comment has been minimized.

Contributor

dorlaor commented Sep 4, 2018

syuu1228 added a commit to syuu1228/scylla that referenced this issue Sep 22, 2018

cql3/lists: Fix multi-cell static list updates in the presence of ckeys
This patch fixes a regression introduced in
9e88b60, which broke the lookup for
prefetched values of lists when a clustering key is specified.

This is the code that was removed from some list operations:

std::experimental::optional<clustering_key> row_key;
if (!column.is_static()) {
  row_key = clustering_key::from_clustering_prefix(*params._schema, prefix);
}
...
auto&& existing_list = params.get_prefetched_list(m.key().view(), row_key, column);

Put it back, in the form of common code in the update_parameters class.

Fixes scylladb#3703

Signed-off-by: Duarte Nunes <duarte@scylladb.com>

syuu1228 added a commit to syuu1228/scylla that referenced this issue Sep 22, 2018

tests/cql_query_test: Test multi-cell static list updates with ckeys
Refs scylladb#3703

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment