Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aerospike_scan_*_async function parameter scan_id ignored #162

Open
jarni-ua opened this issue Jan 17, 2025 · 3 comments
Open

aerospike_scan_*_async function parameter scan_id ignored #162

jarni-ua opened this issue Jan 17, 2025 · 3 comments

Comments

@jarni-ua
Copy link

How is that the variable scan_id is not initialized/set/utilized anywhere in the aerospike_scan_*_async functions?

For example: https://github.com/aerospike/aerospike-client-c/blob/master/src/main/aerospike/aerospike_scan.c#L1437

The function documentation doesn't mention that it is not implemented:

* @param scan_id		The id for the scan job.  Use NULL if the scan_id will not be used.
@BrianNichols
Copy link
Member

The original scan implementation did not allow retries, so there was only one scan_id per scan. Around 5 years ago, the scan implementation was changed to "scan by partition" and allow those partition scans to be retryable. The server rejects duplicate scan_ids, so each retry had to use a different internally generated scan_id.

This made it impossible to use the legacy scan_id argument to aerospike_scan_async(). That scan_id has been ignored since that time. I will update the api doc to say that the scan_id argument is ignored.

@jarni-ua
Copy link
Author

@BrianNichols Thank you very much for the explanation. Yes, documentation update would remove the confusion.

Two followup quesitons.

  1. Is there a way to get status/monitor scan progress/wait for it to finish? Because of the scan_id issue I assume aerospike_scan_info and aerospike_scan_wait can't be used.
  2. Is returning false from as_async_scan_listener the only way to interrupt scan?

@BrianNichols
Copy link
Member

BrianNichols commented Jan 21, 2025

For foreground scans (like aerospike_scan_async()), the best that could be done is list all scan/query status:

asadm -e 'show jobs queries'

Background scans (aerospike_scan_background()) use the old scan protocol, so the scan_id can either be passed in or retrieved if a NULL scan_id is passed in. aerospike_scan_info() and aerospike_scan_wait() still work if the scan_id is known.

The scan can also be stopped via a server command:

asadm -e 'enable; manage jobs kill trid <scanid>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants