client.ScanAll does not call the ScanCallback function

Hi,

I am just 2 day old with C#.

My env: Mac, Mono, Xamarin :slight_smile:

My current task is to read all the records from the cluster. So I used the ScanAll method just like mentioned in the example in github:ScanParallel

The problem is that the ScanCallback is not being called at all.

here is my code: Please dont bother with my hard coded values: I am sure there is far bigger thing to be concerned about

using System; using System.Collections; using System.Threading; using Aerospike.Client; using System.Diagnostics; using System.Linq;

namespace ScanDelete { public class ESPRep1 {

  AerospikeClient client;
  public ESPRep1 (String hostname, int port, Hashtable nsSets)
  {
  	Stopwatch watch = new Stopwatch ();
  	watch.Start ();
  	scan ();
  	watch.Stop ();
  	Console.WriteLine ("Total time =" + watch.Elapsed);
  }
  public void scan(){
  	client = new AerospikeClient ("127.0.0.1", 3000);
  	DateTime begin = DateTime.Now;
  	ScanPolicy policy = new ScanPolicy();
  	policy.concurrentNodes = true;
  	policy.maxConcurrentNodes = client.Nodes.Length;
  	Console.WriteLine("number of nodes =  " + client.Nodes.Length);
  	client.ScanAll(policy, "test", "set1", ScanCallback );
  	DateTime end = DateTime.Now;
  	double seconds = end.Subtract(begin).TotalSeconds;
  }
  public void ScanCallback(Key key, Record record)
  {
  	Console.WriteLine ("I got inside this");
  }

} }

Do I not have something like implements in java and just implement the ScanCalllBack interface and then override the ScanCallback method

regards

Cases where scan callback not called.

  1. There is no data in namespace “test” and set “set1”.
  2. An exception was thrown in ScanAll().

The scanAll function doesn’t come out of the waitTillComplete method of the executor class

If that is the case, then the server is not responding to the scan command. Try the packaged scan examples to see if they work for you.

No they dont

only the scan commands dont work and we have discussed this to a good extent here

This situation occurs only when I am on a vagrant box and this is not the case when I am on an ubuntu

so now I have a Ubuntu VM inside my mac and i have an asd inside the ubuntu which is the way around now

but it would be great to solve this issue with all my docker boxes

regards

We have seen issues with vagrant boxes, where during client initiated cancellations, a RST packet is not correctly propagated to the guest container. This can in term cause all server side scan threads to be stuck on the send() function.

With a freshly restarted asd where no scans has been done, does a backup go through? Does any scan example successfully go through?

Okay

but even on a freshly restarted asd the scans dont go through and none of the scan examples are successful!!!

When you have a freshly restarted asd, can you add a few records, then do a backup using the backup tool. Does that go through? if not, can you give the full verbose log of the backup tool, and the corresponding server log?