特定集中的索引已损坏

杰罗姆·格罗塞(JérômeGrossé)

我们遇到了一个问题,该问题涉及使用辅助键丢失记录。一个名为user的集合包含以下容器名称,电子邮件,密码,角色private_token-在容器private_token上具有辅助密钥

关于此问题:截至上周,Google Cloud中有四个节点。用户设置的辅助键工作正常。在上周末,我们创建了一个新节点,现在,当使用辅助键查询该特定集合时,该特定集合停止返回任何数据。关于其他所有具有相似配置的集合,他们一直返回正确的值。

用户集的名称空间n1正在使用非本地SSD存储。

为了解决该问题,我们创建了一个新的命名空间,即test,存储在内存中。这是一个脚本,该脚本在n1名称空间中失败,但在测试名称空间中成功:

INSERT INTO test.user (PK, name, email, password, role, private_token) VALUES ('[email protected]', 'Test 1', '[email protected]', 'password_test_1', 'role_test_1', 'private_token_1')
INSERT INTO test.user (PK, name, email, password, role, private_token) VALUES ('[email protected]', 'Test 2', '[email protected]', 'password_test_2', 'role_test_2', 'private_token_2')
CREATE INDEX user_private_token ON test.user(private_token) STRING


SELECT * FROM test.user WHERE private_token = 'private_token_2'

这是测试名称空间中的输出:

+----------+------------------+-------------------+---------------+-------------------+
| name     | email            | password          | role          | private_token     |
+----------+------------------+-------------------+---------------+-------------------+
| "Test 2" | "[email protected]" | "password_test_2" | "role_test_2" | "private_token_2" |
+----------+------------------+-------------------+---------------+-------------------+
1 row in set (0.001 secs)

在n1命名空间中:

0 rows in set (0.001 secs)

Aerospike的版本:

$ dpkg -l | grep aerospike
ii  aerospike-amc-community                   3.6.4                         all          AMC Community Version is a web UI based monitoring tool for Aerospike Community Edition Server releases after 2.6.3 (March 2013)
ii  aerospike-server-community                3.6.4-1                       amd64        The Aerospike distributed datastore allows fully scalable and reliable data storage with elastic server properties.
ii  aerospike-tools                           3.6.3                         amd64        Aerospike server tools.

尝试对asadm进行故障排除:

$ asadm
Aerospike Interactive Shell, version 0.0.13
Found 6 nodes
Online:  10.240.0.3:3000, 10.240.0.4:3000, 10.240.0.5:3000, 10.240.0.2:3000, 10.240.0.6:3000
Offline: 10.240.0.9:3000

Admin> info network
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          Node               Node                                           Fqdn                Ip   Client     Current     HB          HB
             .                 Id                                              .                 .    Conns        Time   Self     Foreign
10.240.0.9       000000000000000    10.240.0.9:3000                                10.240.0.9:3000      N/E         N/E    N/E         N/E
aerospike-vm-1   BB90300F00A0142    aerospike-vm-1.c.citiservi-ads.internal:3000   10.240.0.3:3000       38   193339236      0   249014840
aerospike-vm-2   BB90500F00A0142    aerospike-vm-2.c.citiservi-ads.internal:3000   10.240.0.5:3000       37   193339236      0   194991137
aerospike-vm-3   BB90400F00A0142    aerospike-vm-3.c.citiservi-ads.internal:3000   10.240.0.4:3000       34   193339236      0   229395269
aerospike-vm-4   BB90200F00A0142    aerospike-vm-4.c.citiservi-ads.internal:3000   10.240.0.2:3000       45   193339236      0   224245394
aerospike-vm-5   *BB90600F00A0142   aerospike-vm-5.c.citiservi-ads.internal:3000   10.240.0.6:3000       37   193339236      0    17162917
Number of rows: 6

Admin> info service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Service Information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          Node   Build   Cluster      Cluster     Cluster    Free   Free    Migrates        Principal    Objects       Uptime
             .       .      Size   Visibility   Integrity   Disk%   Mem%   (tx,rx,q)                .          .            .
10.240.0.9       N/E         N/E   N/E          N/E           N/E    N/E   N/E         N/E                   N/E   N/E
aerospike-vm-1   3.6.4         5   True         True           61     68   (0,0,0)     aerospike-vm-5   58.618 M   1710:56:06
aerospike-vm-2   3.6.4         5   True         True           61     69   (0,0,0)     aerospike-vm-5   57.594 M   1472:30:21
aerospike-vm-3   3.6.4         5   True         True           61     68   (0,0,0)     aerospike-vm-5   57.430 M   1638:33:39
aerospike-vm-4   3.6.4         5   True         True           61     68   (0,0,0)     aerospike-vm-5   58.242 M   1824:25:55
aerospike-vm-5   3.6.4         5   True         True           61     71   (0,0,0)     aerospike-vm-5   57.774 M   102:48:57
Number of rows: 6

Admin> info sindex
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/bin/asadm/__main__.py", line 20, in <module>
  File "/usr/bin/asadm/asadm.py", line 339, in main
  File "/usr/lib/python2.7/cmd.py", line 141, in cmdloop
    line = self.precmd(line)
  File "/usr/bin/asadm/asadm.py", line 108, in precmd
  File "/usr/bin/asadm/lib/controllerlib.py", line 176, in execute
  File "/usr/bin/asadm/lib/controllerlib.py", line 120, in __call__
  File "/usr/bin/asadm/lib/controllerlib.py", line 176, in execute
  File "/usr/bin/asadm/lib/controller.py", line 158, in do_sindex
TypeError: string indices must be integers, not str

如何修复集合并再次获得工作索引?

提前致谢

罗恩·博泽(Ronen Botzer)

可能仍然不是问题,但是《操作手册》的“管理索引”一文提供了有关如何修复索引的信息。自从3.6版开始引用以来,二级索引上也做了很多工作

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章