Comments (6)
We have found the bug, and will be working on a fix shortly.
The bug is that even though the policy.fail_on_cluster_change
sent with the operation is false
, it is not being picked up b/c the client configuration defines the global fail_on_cluster_change
as true
.
We will provide a fix shortly. For the near term, you can define fail_on_cluster_change=false
in the configuration used to initialize the client. This will mean if you want fail_on_cluster_change=true
for an operation, then it needs to be explicit, as it will not longer be the default.
from aerospike-client-c.
Thanks for the quick reply!
But it seems that even the default policy is not working:
int main() {
aerospike as;
as_config cfg;
as_config_init(&cfg);
cfg.hosts[0].addr = "127.0.0.1";
cfg.hosts[0].port = 3000;
cfg.policies.scan.fail_on_cluster_change=false;
as_error err;
if (aerospike_connect(aerospike_init(&as, &cfg), &err) != AEROSPIKE_OK) {
LOG("aerospike_connect() returned %d - %s", err.code, err.message);
aerospike_destroy(&as);
return -1;
}
as_scan scan;
as_scan_init(&scan, "database", "userdata");
LOG("starting scan all ...");
if (aerospike_scan_foreach(&as, &err, NULL, &scan, scan_cb, NULL) != AEROSPIKE_OK) {
LOG("aerospike_scan_foreach() returned %d - %s", err.code, err.message);
as_scan_destroy(&scan);
return -2;
}
LOG("scan finished");
return 0;
}
The result is similar to the previous one.
from aerospike-client-c.
Apologies, looking back at the code, I realize that it would not have worked.
https://github.com/aerospike/aerospike-client-c/blob/master/src/main/aerospike/_policy.c#L86
p->fail_on_cluster_change = as_policy_resolve(fail_on_cluster_change, global->scan, local, true);
We will provide a fix.
You are welcome to short circuit that line of code, and we will have a solution out in the near future.
The change I would make to that line of code for your immediate needs would be to have:
p->fail_on_cluster_change = as_policy_resolve(fail_on_cluster_change, global->scan, local, false);
The fix we have in mind would be to introduce an "undefined" value for boolean fields, which is what they will initialize to. This will allow the fallback mechanism will function properly, such that it will allow you to define a "false" for the policy value, and ensure it is false.
from aerospike-client-c.
For boolean policy values, we are using -1
to indicate an undefined value. So, the boolean policy values are initialized to -1
, so it leaves you free to set a client global value or operation specific value. If -1
is specified for both client and operation, then the fallback will be true
.
from aerospike-client-c.
Apologies, I rushed in the change and did not make a crucial change to the code, by changing fail_on_cluster_change
to an int
or enum
type. That change will be coming soon.
from aerospike-client-c.
Just pushed the change. It is now functioning. Please verify it meets your needs.
from aerospike-client-c.
Related Issues (20)
- warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] HOT 1
- warning: 'MSG_NOSIGNAL' macro redefined (on macOS) HOT 1
- Deleting bins by setting values to null or empty string HOT 1
- Undefined symbols in static library HOT 2
- cmake support HOT 4
- Is this project still under maintenance HOT 1
- Unable to found benchmarks in aerospike-client-c HOT 2
- Logstash Pipeline Error
- Crash in as_node_ensure_login_shm when remote servers are restarted HOT 16
- Compile failed with "the clang compiler does not support '-march=nocona'" HOT 2
- crash inside as_cluster_tend on arm64 HOT 4
- Give a name to worker threads HOT 3
- apple silicon / arm support HOT 9
- Release tagged 4.6.24 refers to missing .gitmodules HOT 1
- On batch reads only AS_POLICY_REPLICA_SEQUENCE will actually find new nodes for requests, AS_POLICY_REPLICA_ANY will try the same node and fail again. HOT 6
- aerospike-client-c link error with extra compiler flags -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer HOT 1
- can not build without lua HOT 1
- Missing as_buffer.h in installed includes HOT 1
- scan callback failing with memory fault issue HOT 1
- Build fails for 6.4.1 with luajit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aerospike-client-c.