How to tell whether an s-index is marked for deletion?

When dropping a secondary index, the documentation states that a background job will removed at next run.

But how/where do I see if an index is marked for deletion?

LarsNymand,

aql > show indexes

shows index in state ‘D’

– R

I thought so :slight_smile:

Because I saw some strange behavior yester reached the stop-write water-mark while migrating.

So I thought that I would remove some outdated secondary indexes, to free up memory and properly speed up the migration process.

I knew that indexes will be delete in a background thread, but I couldn’t see that the indexes was marked for deletion. (The drop command didn’t throw an exception)

Maybe it is not possible to drop a index while migrating? and should it not be possible to mark for deletion while migration (for the background task to pickup afterwards?)

As it is right now I can’t debug/find more information on this, because the server crashed. But maybe that is not needed if the answer is that it is not possible to drop the index while migration is in progress? :slight_smile:

Hi LarsNymand,

If the drop request has gone through without throwing exception, that means server will process this request.

To formulate a theory, can you share the following details with us?

  1. How do you know that sindex was not deleted ?
  2. The stack trace from the log file. (You will get this once the server crashes.)
  3. Aerospike server build number.

To be clear, it is possible to drop indexes during migrating

Hi partyyy,

I really would like to give you some stack trace logs… but there are none… This server seems to have IO troubles (which is why we are migrating to a new server) so I think either it wasn’t able to write the log in time, or it some how lost connection to the harddrive.

The build version was 3.5.8 and I checked it through aql> show indexes. The state did not change.

Based on how little data I am able to find about the crash, I am not sure if it makes sense to look deeper into.

But the server is started now, and I can see that it started to build the secondary indexes (also the ones I marked for deletion).

So I will try the following now: I got two nodes. On the first server the index I want to deleted has the State: RW and sync_state: synced On the second server the index has the State: WO and sync_state: synced

So the expectations are: After dropping the index, both servers will change the State to D, stop building the index and start deleting it. (right? :slight_smile: )

wait. I just realized the I think I did it through the AMC interface, where the loading icon was spinning, but I am not sure if it ever stopped spinning or throw an error I didn’t see.

I can also confirm that through AQL the above was exactly what happened. The first server just dropped the index an does not exists on the list anymore. The second server set the State: D

So I suppose it works like it should, but maybe the interface delete command, didn’t get through…

Cool. Though I’ll advise you to upgrade to the latest server version if you can.

Thanks