Closed kunalchinawale closed 10 months ago
Agreed that the loader shouldn't EAFP and not check roles in advance, just handle a role violation failure.
Hi! Sorry for the long delay but asloader 4.0.2 removed this check completely so this should no longer be an issue. Closing...
Hi, I am using aerospike loader for loading data to my aerospike database. However, facing issue with the role name. Upon debugging a bit I found that it checks for role name as "read-write" in a role list for the user (AerospikeLoad.java line 274 to 280). As "read-write" is a default role and used by admin user, I have separate roles for different namespaces in a format like "namespace-read-write" but it does't match and loader fails. I tried with changing if (!client.queryUser(null, clientPolicy.user).roles.contains(Role.ReadWrite)) to if (!client.queryUser(null, clientPolicy.user).roles.contains("mynamespace-read-write")) (which is role name is my case) at AerospikeLoad.java line 276 and it works perfectly fine.
Can we handle the prefixes added to role names as using default "read-write" for every namespace is not an ideal situation?
FYI detail for referance: ERROR AerospikeLoad :277 - User role:[mynamespace-read-write] Expected:read-write INFO AerospikeLoad :253 - Aerospike loader completed