【问题标题】:Aerospike - “n_bytes_memory went negative” with in memory-only namespace with ttlAerospike - “n_bytes_memory 变为负数”,在带有 ttl 的仅内存命名空间中
【发布时间】:2016-02-28 10:21:26
【问题描述】:

我们有一个命名空间配置为在内存中存储数据只有几分钟的默认 ttl。在开始将一些数据放入其中后,当到期开始时,我们会在日志中收到这些消息(很多,大约 30% 的到期记录): WARNING (namespace): (namespace.c::762) set_id 1 - n_bytes_memory went negative!

我有一个带有服务器配置的简单客户端应用程序,可以重现这个:https://github.com/akkomar/aerospike-test(它基于 docker,很容易上手)

任何建议可能是什么原因?

编辑:

我在 3.6.4、3.7.0.1 和 3.7.4 版本上检查了这一点

用于测试的配置文件(来自https://github.com/akkomar/aerospike-test/blob/master/etc/aerospike.conf):

service {
    user root
    group root
    paxos-single-replica-limit 1
    pidfile /var/run/aerospike/asd.pid
    service-threads 4
    transaction-queues 4
    transaction-threads-per-queue 4
    proto-fd-max 1024
}

logging {
    file /var/log/aerospike/aerospike.log {
        context any info
    }
    console {
        context any info
        context namespace detail
    }
}

network {
    service {
        address any
        port 3000
    }
    heartbeat {
        mode mesh
        port 3002
        mesh-port 3002
        interval 150
        timeout 10
    }
    fabric {
        port 3001
    }

    info {
        port 3003
    }
}

namespace test_ns {
  replication-factor 2
  memory-size 1G
  default-ttl 10S

  storage-engine memory
}

编辑2:

似乎只有当我通过 UDF 更新记录时才会发生这种情况。最简单的重现这个:

local VAL_KEY = "v"

function add_data(rec, val_to_add, ttl_to_set)
    if aerospike:exists(rec) then
        rec[VAL_KEY] = val_to_add

        aerospike:update(rec)
    else
        rec[VAL_KEY] = val_to_add

        aerospike:create(rec)
    end

end

当我通过 Java API 执行相同的操作时 - 一切似乎都运行良好(前面提到的示例 github repo 已更新为 Java API 示例)

【问题讨论】:

  • 能否请您发布 Aerospike.conf 和版本信息。
  • @BenBates 添加了版本信息和 aerospike.conf 内容

标签: aerospike


【解决方案1】:

错误信息的意思是我们在内存中占到集合的空间变成了负数,这是不可能的。

这已记录在我们的内部错误跟踪系统中,以便在未来的版本中解决

【讨论】:

    【解决方案2】:

    原来这是 Aerospike 中的一个错误。 3.7.4.1版本修复(详细解释见https://discuss.aerospike.com/t/problem-with-expiring-records-in-memory-only-namespace-n-bytes-memory-went-negative/2560/6)

    【讨论】:

      猜你喜欢
      • 2015-12-19
      • 2015-12-10
      • 1970-01-01
      • 2019-08-11
      • 1970-01-01
      • 1970-01-01
      • 2017-01-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多