iFIX Core Data Cleanup

Overview

This page provides details on the steps involved in cleaning up the iFIX core data from various environments. Follow the instructions specific to select environment listed below.

  • Druid Data Clean-Up

  • Mongo DB Data Clean-Up

  • Postgres Data Clean-Up process.

Druid Data Clean-up

  • Open the druid console in the respective environment.

  • Go to Ingestion Supervisors. And select the particular supervisor (fiscal-event)

    1. In Action, click on Terminate. This terminates the supervisor. Wait for a minute.

  • Go to DataSources and select the particular data source name (fiscal-event). And scroll down to Action.

    1. Click on the Mark as unused all segmentsMark as unused all segments.

  • Click on Delete unused segments (issue kill task) and enable the permission to delete.

Once the clean-up process is completed, follow the instructions here - IFIX Fiscal Event Post Processor | Druid-Sink to run the supervisor.

MongoDB Data Clean-up

  • Connect to the playground pod and run the command below to connect with mongo DB. mongo --host <mongo-db-host>:<mongo-db-port> -u <mongo-db-username> -p <mongo-db-password>

  • Use the ifix core DB; use <db name>

  • Run the below command to delete all the data from fiscal_event collection. db.fiscal_event.remove({});

  • If you want to delete all fiscal event records of a particular Gram Panchayat then run the command below.

Here let us assume, we have to delete "LODHIPUR" GP (Gram Panchayat) details (that is hierarchy level 6) in the DWSS department. Run the command below.

db.fiscal_event.remove({"departmentEntity.ancestry.6.name":{$eq:"LODHIPUR"}});
  • If you want to delete a fiscal event record based on some other attributes, you have to write a custom mongo delete query.

PostgresDB Data Clean-up

  • Connect to the playground pod and run the below command to connect with postgresDB.

    psql -h <psql-host> -p <psql-port> -d <psql-database> -U <psql-username>

  • It prompts for a password. Enter the password.

  • Run the below query to delete all the data from fiscal_event_aggregated.

DELETE FROM fiscal_event_aggregated;
  • If you want to delete the particular Gram Panchayat details from fiscal event aggregated record, run the query below.

Here let us assume, we want to delete "LODHIPUR" GP (Gram Panchayat) details (that is hierarchy level 6) in the DWSS department.

DELETE FROM fiscal_event_aggregated where departmentEntity_ancestry_6_name='LODHIPUR';

Note: If you are not sure about deleting the fiscal event aggregated record, you can delete all the records from the fiscal_event_aggregated table. Once the records are deleted, either run the fiscal event aggregate Cron Job manually to UpSert all the records or the system UpSerts the records every midnight from Druid to Postgres.

Last updated

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.