Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-3000

Create an ability to recover if policy database gets corrupted

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Won't Do
    • Icon: Medium Medium
    • Kohn Release
    • None
    • all
    • Policy 5/6 - 5/20, Policy 23/6 - 7/7, Policy 12/7-26/7, Policy 04/11-17/11, Policy 18/11-01/12, Policy 02/12-15/12, Policy 18/01/22-31/01/22

      As a ONAP developer, I would like to create an ability to recover from situations where policy database is corrupted due to system, server or any other failures. As redeployment of entire Policy Framework requires downtime and very high chance of losing all the policies & related data.

      The corruption was last observed in Bell Canada internal environment. Below are some logs snippet from the server.

      PolicyDB logs

      MariaDB [policyadmin]> show tables;
      +-------------------------------------+
      | Tables_in_policyadmin               |
      +-------------------------------------+
      | jpapdpgroup_properties              |
      | jpapdpstatistics_enginestats        |
      | jpapdpsubgroup_policies             |
      | jpapdpsubgroup_properties           |
      | jpapdpsubgroup_supportedpolicytypes |
      | jpatoscadatatype_constraints        |
      | jpatoscadatatype_metadata           |
      | jpatoscadatatype_properties         |
      | jpatoscapolicy_metadata             |
      | jpatoscapolicy_properties           |
      | jpatoscapolicy_targets              |
      | jpatoscapolicytype_metadata         |
      | jpatoscapolicytype_properties       |
      | jpatoscapolicytype_targets          |
      | jpatoscapolicytype_triggers         |
      | jpatoscaservicetemplate_metadata    |
      | pdp                                 |
      | pdpgroup                            |
      | pdpgroup_pdpsubgroup                |
      | pdpstatistics                       |
      | pdpsubgroup                         |
      | pdpsubgroup_pdp                     |
      | toscadatatype                       |
      | toscadatatypes                      |
      | toscadatatypes_toscadatatype        |
      | toscapolicies                       |
      | toscapolicies_toscapolicy           |
      | toscapolicy                         |
      | toscapolicytype                     |
      | toscapolicytypes                    |
      | toscapolicytypes_toscapolicytype    |
      | toscaservicetemplate                |
      | toscatopologytemplate               |
      +-------------------------------------+
      33 rows in set (0.00 sec)
      
      
      MariaDB [policyadmin]> select * from pdpgroup;
      ERROR 1932 (42S02): Table 'policyadmin.pdpgroup' doesn't exist in engine
      MariaDB [policyadmin]> select * from pdpsubgroup;
      ERROR 1932 (42S02): Table 'policyadmin.pdpsubgroup' doesn't exist in engine
      

      PAP Logs

      Caused by: org.eclipse.persistence.exceptions.DatabaseException: 
      Internal Exception: java.sql.SQLSyntaxErrorException: (conn=23684) Table 'policyadmin.pdpgroup' doesn't exist in engine
      Error Code: 1932
      Call: SELECT DESCRIPTION, PDPGROUPSTATE, name, version FROM PdpGroup
      Query: ReadAllQuery(referenceClass=JpaPdpGroup sql="SELECT DESCRIPTION, PDPGROUPSTATE, name, version FROM PdpGroup")
      	at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:342)
      	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:691)
      	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:567)
      	at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2099)
      	at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:603)
      	at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:275)
      	at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:261)
      	at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:332)
      	at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:744)
      	at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2759)
      	at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2712)
      	at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:584)
      	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1232)
      	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911)
      	at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1191)
      	at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:485)
      	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1279)
      	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2983)
      	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1898)
      	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1880)
      	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1845)
      	at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:262)
      	... 64 common frames omitted
      Caused by: java.sql.SQLSyntaxErrorException: (conn=23684) Table 'policyadmin.pdpgroup' doesn't exist in engine
      	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:177)
      	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110)
      	at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:228)
      	at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:216)
      	at org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(MariaDbPreparedStatementClient.java:150)
      	at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeQuery(MariaDbPreparedStatementClient.java:164)
      	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1015)
      	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:651)
      	... 84 common frames omitted
      Caused by: java.sql.SQLException: Table 'policyadmin.pdpgroup' doesn't exist in engine
      Query is: SELECT DESCRIPTION, PDPGROUPSTATE, name, version FROM PdpGroup
      	at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:153)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:255)
      	at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(MariaDbPreparedStatementClient.java:209)
      	... 88 common frames omitted

       

        There are no Sub-Tasks for this issue.

            liamfallon liamfallon
            ramverma ramverma
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: