Query: how to amend records in aggregateUDF [Resolved]

Hi guys,

I need to iterate through all my records in set and then amend 2 fields in it. What is the best way to go about doing it? I tried using Query stream with aggregateUDF, but it’s throwing me code100 errors. I then tried calling UDF individually from the stream.on(“data”, function(rec) {…, but this chokes up my server shortly after… Any tips?

Regards, Zhongcai

Please make sure you’re following the Lua UDF - Best Practices, and quote the lines from the UDF log that show what is going on. When you have an error with code 100, further details are most likely to present themselves in the log.

Next, please quote your UDF code here. Hard to debug code you can’t see. For comparison, look at this similar issue: Unable to get simple filter/map to work using Python client (AER-4251) [Released]

Hi,

Below crashed Aerospike… Not sure if enough information provided.

client.connect(function(res) {
 ...
});

var statement= {
	concurrent: true,
	nobins: false,
	select: ["...", "...", "..."],
	scanPriority: 0
};

var scan= client.query("...", "...", statement);
var stream= scan.execute();

stream.on("data", function(rec) {
	var key= { ns: "...", set: "...", key: rec.bins.index }
	var udf= { module: "...", funcname: "...", args: [...] }
	client.execute(key, udf, function(err) {
	});
});

stream.on("error", function(err) {
});

stream.on("end", function() {
});

Like to find out the best practices to backing up and stuff…

  1. So my server crashed, and I couldn’t restart my beta EC2 m4-xlarge machine. ie, from AWS management console, the server just changes from pending to stopped
  2. Saw the Aerospike docs on backing up. asbackup and asrestore looks like command line tools to run manually
  3. I guess my bet is to run an additional node and add it to the cluster via the Aerospike dashboard. And then let the automatic rebalancing takes it course auto-magically?
  4. In my situation, is there anything I could have done? Given that I cannot even restart the machine.

Hi Zhongcai_Ng

  1. Is it possible to get log of the server crashed? Is it a aerospike server crash or machine is down?

  2. Please give details what you are trying to do, take backup or to add new node to cluster?

  3. If you had replication factor > 2 then you can run the backup without adding another node also. But before running asbackup make sure migration get finished.

Turns out that the records were exceeding the size limit

1 Like