I tried using the delete API to delete users I had...
# troubleshoot
s
I tried using the delete API to delete users I had created earlier before the delete API was released as per https://datahubproject.io/docs/how/delete-metadata/#delete-by-urn
Copy code
$ datahub init
Configure which datahub instance to connect to
Enter your DataHub host [<http://localhost:8080>]: <http://datahub-datahub-gms.apps.svc.cluster.local:8080>
Enter your DataHub access token (Supports env vars via `{VAR_NAME}` syntax) []:
Written to /home/datahub/.datahubenv
$ datahub delete --urn "urn:li:corpuser:aseem.bansal"
This will permanently delete data from DataHub. Do you want to continue? [y/N]: y
Successfully deleted urn:li:corpuser:aseem.bansal. 0 rows deleted
It says
Copy code
0 rows deleted
I have noticed that delete API works for anything that was created after the delete API was released but does not seem to work for things created before that version
g
Hey Aseem- your observation is correct.
The delete API is not able to delete any elements created before its release. This is because after the API was released, we started annotating metadata with some additional system metadata used for deleting.
Is this a problem for you?
s
Not a problem we cannot find a solution for. If I wanted to clean these up then I guess I would need to go to mysql, delete the rows for those urn manually and then run a restore indices job?
g
Yep, that would work!
s
Thanks
Just an observation - the system metadata for users created before this is not getting updated. I wanted to see lastObserved system metadata for all users. It is being updated for users created after this but not before this change. Not sure if this is intended behaviour
h
@green-football-43791 I was trying to delete some old stuff but realized that deleting the rows in the GMS DB and restoring the indices doesn't clear the ES indices (using it for graph and search). What's the best way to clean ES?
s
There is another
clean
flag that you need to pass to delete data in the restore job. That does remove things after deletion in the GMS DB
🙌 1
h
Awesome, thanks for the tip! I was deleting documents by hand 🤦