Of course such namespace is created, but such error nevertheless periodically appears (not all the time, several times per hour).
This error occurs when we use the lua script.
Unfortunately on server side there are no any unusual logs, or some logs that indicate a problem.
We use such simple lua script:
function Test (rec, bin, value)
if (EXISTS(rec, bin)) then
m = rec[bin] + value
rec[bin] = m
UPDATE(rec)
return m
else
rec[bin] = value
UPDATE(rec)
return value
end
end
local function UPDATE(rec)
if aerospike:exists(rec) then
aerospike:update(rec)
else
aerospike:create(rec)
end
end
I doubt the lua script is related to the error. That error message is generated by the client before the lua command is even sent to the server.
The error means the namespace is not found in data partition map (keyed by namespace). This is odd because namespaces are statically configured on the server-side and never change while the server is running. When the AerospikeClient instance is constructed, the namespaces are retrieved from the servers. Namespaces are not deleted on the client after that initialization.
A snippet of the client code that calls the lua commands would be helpful.
It appears that you have multiple client instances. Is it possible that one of the client instances is not fully initialized or points to a different cluster with different namespaces?
Try printing out the namespaces when you get the error in Command.cs, GetSequenceNode().
if (!map.TryGetValue(partition.ns, out partitions))
{
// Add these lines
StringBuilder sb = new StringBuilder(1000);
sb.Append("Invalid namespace: ");
sb.Append(partition.ns);
sb.Append(" current namespaces: ");
foreach (string key in map.Keys)
{
sb.Append(key);
sb.Append(' ');
}
throw new AerospikeException(sb.ToString());
}