0

我发现为什么我在 cassandra 的二级索引列中的查询会导致 rpc 超时。

这是我关于 cassandra 和桌子的详细信息

[cqlsh 4.1.1 | Cassandra 2.0.7 | CQL spec 3.1.1 | Thrift protocol 19.39.0]


cqlsh:master_hub_development> describe table service_hubs;

CREATE TABLE service_hubs (
  id uuid,
  host text,
  hub_name text,
  os text,
  owner text,
  pubkey text,
  service_type text,
  trust int,
  PRIMARY KEY (id)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};

CREATE INDEX service_hubs_host_idx ON service_hubs (host);

CREATE INDEX service_hubs_hub_name_idx ON service_hubs (hub_name);

CREATE INDEX service_hubs_os_idx ON service_hubs (os);

CREATE INDEX service_hubs_owner_idx ON service_hubs (owner);

CREATE INDEX service_hubs_pubkey_idx ON service_hubs (pubkey);

CREATE INDEX service_hubs_service_type_idx ON service_hubs (service_type);

CREATE INDEX service_hubs_trust_idx ON service_hubs (trust);

cqlsh:master_hub_development> select * from service_hubs;

 id                                   | host           | hub_name           | os     | owner         | pubkey | service_type | trust
--------------------------------------+----------------+--------------------+--------+---------------+--------+--------------+-------
 b9d9bd06-e006-11e3-a1e2-3382b7d578d2 | localhost:3001 |      HUB:Darknetdb | Mac os | darknet_admin |   null |    darknetdb |    90
 b9d74918-e006-11e3-a1e2-3382b7d578d2 | localhost:3000 | HUB:Darknetbitcoin | Mac os | darknet_admin |   null |      bitcoin |    90
 b9da9b2c-e006-11e3-a1e2-3382b7d578d2 | localhost:3002 |   HUB:Darknetemail | Mac os | darknet_admin |   null |        email |    90
 b9db8596-e006-11e3-a1e2-3382b7d578d2 | localhost:3003 |     HUB:Darknetftp | Mac os | darknet_admin |   null |          ftp |    90

(4 rows)

cqlsh:master_hub_development> select * from service_hubs where host='localhost:3001';

 id                                   | host           | hub_name      | os     | owner         | pubkey | service_type | trust
--------------------------------------+----------------+---------------+--------+---------------+--------+--------------+-------
 b9d9bd06-e006-11e3-a1e2-3382b7d578d2 | localhost:3001 | HUB:Darknetdb | Mac os | darknet_admin |   null |    darknetdb |    90

(1 rows)

cqlsh:master_hub_development> select * from service_hubs where service_type='darknetdb';
Request did not complete within rpc_timeout.

在这里,我们可以看到对二级索引列 host 的查询成功,但对 service_type 的类似查询得到 rpc_timeout 错误。

我无法找到它在此查询中出现 rpc_timeouted 的原因。

select * from service_hubs where service_type='darknetdb';

谢谢

4

0 回答 0