OOM Testing
ssh to the host e.g. ssh <your id>@172.15.3.28
Switch to root user: sudo su
Change to home directory for root: cd or cd ~
Change to oom/kubernetes directory: cd oom/kubernetes
Make the changes in the policy helm charts.
Run make command: make policy
Then make onap: make SKIP_LINT=TRUE onap
Update repo: helm repo update
To list deployment names: helm list
Undeploy the existing policy deployment : helm undeploy <deployment name>
Redeploy: helm deploy <deployment-name> local/onap -f ~/integration-override.yaml --namespace onap --verbose
Further information can be found here: https://github.com/onap/oom/blob/master/docs/oom_quickstart_guide.rst
- POLICY-3487Getting issue details... STATUS
Restarting the VM
sudo shutdown --reboot now
When the machine comes back up run: chartmuseum --storage local --storage-local-rootdir ~/helm3-storage -port 8879 &
Check the worker nodes to make sure they are running:
kubectl get nodes
NAME STATUS ROLES AGE VERSION
esy-master-policy-002-k8s-01 Ready worker 34d v1.19.7
esy-master-policy-002-k8s-02 Ready worker 34d v1.19.7
esy-master-policy-002-orch-1 Ready controlplane,etcd 34d v1.19.7
Update Steps for POLICY-3487
copy db_migrator_policy_init.sh to kubernetes/policy/resources/config/
#!/bin/sh /opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB} /opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade rc=$? /opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report exit $rc
Update kubernetes/policy/templates/configmap.yaml (configmap.yaml)
apiVersion: v1 kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-db-configmap namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ include "common.release" . }} heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/*.sh").AsConfig . | indent 2 }}
Update kubernetes/policy/values.yaml (values.yaml)
################################################################# # DB configuration defaults. ################################################################# repository: nexus3.onap.org:10001 pullPolicy: Always mariadb: image: mariadb:10.5.8 dbmigrator: image: onap/policy-db-migrator:2.3.0-SNAPSHOT schema: policyadmin policy_home: "/opt/app/policy" subChartsOnly: enabled: true
Update kubernetes/policy/templates/job.yaml (job.yaml)
apiVersion: batch/v1 kind: Job metadata: name: {{ include "common.release" . }}-policy-galera-config namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }}-job release: {{ include "common.release" . }} spec: template: metadata: labels: app: {{ include "common.name" . }}-job release: {{ include "common.release" . }} spec: imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" initContainers: #This container checks that all galera instances are up before initializing it. - name: {{ include "common.name" . }}-readiness image: {{ include "repositoryGenerator.image.readiness" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} command: - /app/ready.py - --container-name - {{ index .Values "mariadb-galera" "service" "name" }} env: - name: NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - name: {{ include "common.release" . }}-policy-galera-config image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.mariadb.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: - mountPath: /dbcmd-config/db.sh name: {{ include "common.fullname" . }}-config subPath: db.sh command: - /bin/sh args: - -x - /dbcmd-config/db.sh env: - name: MYSQL_ROOT_PASSWORD {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 10 }} - name: MYSQL_HOST value: "{{ index .Values "mariadb-galera" "service" "name" }}" - name: MYSQL_USER {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} - name: MYSQL_PORT value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}" resources: {{ include "common.resources" . }} containers: - name: {{ include "common.release" . }}-policy-galera-db-migrator image: {{ .Values.repository }}/{{ .Values.dbmigrator.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: - mountPath: /dbcmd-config/db_migrator_policy_init.sh name: {{ include "common.fullname" . }}-config subPath: db_migrator_policy_init.sh command: - /bin/sh args: - -x - /dbcmd-config/db_migrator_policy_init.sh env: - name: SQL_HOST value: "{{ index .Values "mariadb-galera" "service" "name" }}" - name: SQL_USER {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }} - name: SQL_PASSWORD {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }} - name: SQL_DB value: {{ .Values.dbmigrator.schema }} - name: POLICY_HOME value: {{ .Values.dbmigrator.policy_home }} resources: {{ include "common.resources" . }} restartPolicy: Never serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} volumes: - name: {{ include "common.fullname" . }}-config configMap: name: {{ include "common.fullname" . }}-db-configmap items: - key: db.sh path: db.sh - key: db_migrator_policy_init.sh path: db_migrator_policy_init.sh
Test Results
get pods
root@esy-master-policy-002-nfs:/home/kevint# kubectl get pods | grep policy
dev-policy-apex-pdp-0 1/1 Running 0 3h22m
dev-policy-api-6c4c87fd64-c5g6k 1/1 Running 0 17h
dev-policy-clamp-be-5c6cb758d8-cr7xc 1/1 Running 0 17h
dev-policy-clamp-fe-569494fb5d-4gdq2 1/1 Running 0 17h
dev-policy-clamp-galera-config-5d76k 0/1 Completed 0 17h
dev-policy-distribution-5b68646475-gjbq8 1/1 Running 0 17h
dev-policy-drools-pdp-0 1/1 Running 0 3h26m
dev-policy-galera-config-tt6mm 0/1 Completed 0 17h
dev-policy-mariadb-0 2/2 Running 0 17h
dev-policy-pap-65ddfc8f54-dmt6w 1/1 Running 0 17h
dev-policy-xacml-pdp-d7dfc9964-wn9zl 0/1 CrashLoopBackOff 266 17h
describe pod
root@esy-master-policy-002-nfs:/home/kevint# kubectl describe pod dev-policy-galera-config-tt6mm
Name: dev-policy-galera-config-tt6mm
Namespace: onap
Priority: 0
Node: esy-master-policy-002-k8s-02/172.16.1.104
Start Time: Thu, 19 Aug 2021 14:47:45 +0000
Labels: app=policy-job
controller-uid=e1875e15-c28e-4063-9d1c-787a4cff37ba
job-name=dev-policy-galera-config
release=dev
Annotations: cni.projectcalico.org/podIP:
cni.projectcalico.org/podIPs:
Status: Succeeded
IP: 10.42.2.11
IPs:
IP: 10.42.2.11
Controlled By: Job/dev-policy-galera-config
Init Containers:
policy-readiness:
Container ID: docker://c1d4ccf52662a3acf7750d97997b0949fc60e432aee480625ea45c230ae20853
Image: nexus3.onap.org:10001/onap/oom/readiness:3.0.1
Image ID: docker-pullable://nexus3.onap.org:10001/onap/oom/readiness@sha256:317c8a361ae73750f4d4a1b682c42b73de39083f73228dede31fd68b16c089db
Port: <none>
Host Port: <none>
Command:
/app/ready.py
--container-name
policy-mariadb
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 19 Aug 2021 14:48:06 +0000
Finished: Thu, 19 Aug 2021 14:48:47 +0000
Ready: True
Restart Count: 0
Environment:
NAMESPACE: onap (v1:metadata.namespace)
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-read-token-pdhhk (ro)
dev-policy-galera-config:
Container ID: docker://a6f5618cff66ec31b5352ce00b0a02c1063890be63d5be83a76ac3aac6eb6756
Image: docker.io/mariadb:10.5.8
Image ID: docker-pullable://mariadb@sha256:8040983db146f729749081c6b216a19d52e0973134e2e34c0b4fd87f48bc15b0
Port: <none>
Host Port: <none>
Command:
/bin/sh
Args:
-x
/dbcmd-config/db.sh
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 19 Aug 2021 14:49:26 +0000
Finished: Thu, 19 Aug 2021 14:49:27 +0000
Ready: True
Restart Count: 0
Environment:
MYSQL_ROOT_PASSWORD: <set to the key 'password' in secret 'dev-policy-db-root-password'> Optional: false
MYSQL_HOST: policy-mariadb
MYSQL_USER: <set to the key 'login' in secret 'dev-policy-db-secret'> Optional: false
MYSQL_PORT: 3306
Mounts:
/dbcmd-config/db.sh from dev-policy-config (rw,path="db.sh")
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-read-token-pdhhk (ro)
Containers:
dev-policy-galera-dbmigrator:
Container ID: docker://bf137b7dd920307e6a518c9ec7db1ae6502ea155161081754b44b217ca317960
Image: nexus3.onap.org:10001/onap/policy-db-migrator:2.3.0-SNAPSHOT
Image ID: docker-pullable://nexus3.onap.org:10001/onap/policy-db-migrator@sha256:59983c3fcf178335839448950033719effea48c1b39e78e5972972ab4965f4cc
Port: <none>
Host Port: <none>
Command:
/bin/sh
Args:
-x
/dbcmd-config/db_migrator_policy_init.sh
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 19 Aug 2021 14:50:09 +0000
Finished: Thu, 19 Aug 2021 14:50:19 +0000
Ready: False
Restart Count: 0
Environment:
SQL_HOST: policy-mariadb
SQL_USER: <set to the key 'login' in secret 'dev-policy-db-secret'> Optional: false
SQL_PASSWORD: <set to the key 'password' in secret 'dev-policy-db-secret'> Optional: false
SQL_DB: policyadmin
POLICY_HOME: /opt/app/policy
Mounts:
/dbcmd-config/db_migrator_policy_init.sh from dev-policy-config (rw,path="db_migrator_policy_init.sh")
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-read-token-pdhhk (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
dev-policy-config:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: dev-policy-db-configmap
Optional: false
dev-policy-read-token-pdhhk:
Type: Secret (a volume populated by a Secret)
SecretName: dev-policy-read-token-pdhhk
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events: <none>
get secrets
/home/kevint# kubectl get secrets | grep policy-db
dev-policy-db-root-password Opaque 1 17h
dev-policy-db-secret Opaque 2 17h
retrieve secret
kubectl get secret dev-policy-db-secret -o jsonpath='{.data}'
{"login":"cG9saWN5X3VzZXI=","password":"U3VqaVJvaGI2LERvbnU="}root@esy-master-policy-002-nfs:~#
root@esy-master-policy-002-nfs:~# echo "cG9saWN5X3VzZXI=" | base64 --decode
policy_user
root@esy-master-policy-002-nfs:~# echo "U3VqaVJvaGI2LERvbnU=" | base64 --decode
policy_user_secret
login to database
kubectl exec -it dev-policy-mariadb-0 -- sh
Defaulting container name to policy-mariadb.
Use 'kubectl describe pod/dev-policy-mariadb-0 -n onap' to see all of the containers in this pod.
$ mysql -upolicy_user -p*********
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 25531
Server version: 10.5.8-MariaDB-log Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use policyadmin;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [policyadmin]> show tables;
+------------------------------------------------------+
| Tables_in_policyadmin |
+------------------------------------------------------+
| jpapdpgroup_properties |
| jpapdpstatistics_enginestats |
| jpapdpsubgroup_policies |
| jpapdpsubgroup_properties |
| jpapdpsubgroup_supportedpolicytypes |
| jpatoscacapabilityassignment_attributes |
| jpatoscacapabilityassignment_metadata |
| jpatoscacapabilityassignment_occurrences |
| jpatoscacapabilityassignment_properties |
| jpatoscacapabilitytype_metadata |
| jpatoscacapabilitytype_properties |
| jpatoscadatatype_constraints |
| jpatoscadatatype_metadata |
| jpatoscadatatype_properties |
| jpatoscanodetemplate_metadata |
| jpatoscanodetemplate_properties |
| jpatoscanodetype_metadata |
| jpatoscanodetype_properties |
| jpatoscapolicy_metadata |
| jpatoscapolicy_properties |
| jpatoscapolicy_targets |
| jpatoscapolicytype_metadata |
| jpatoscapolicytype_properties |
| jpatoscapolicytype_targets |
| jpatoscapolicytype_triggers |
| jpatoscaproperty_constraints |
| jpatoscaproperty_metadata |
| jpatoscarelationshiptype_metadata |
| jpatoscarelationshiptype_properties |
| jpatoscarequirement_metadata |
| jpatoscarequirement_occurrences |
| jpatoscarequirement_properties |
| jpatoscaservicetemplate_metadata |
| jpatoscatopologytemplate_inputs |
| pdp |
| pdpgroup |
| pdpgroup_pdpsubgroup |
| pdppolicystatus |
| pdpstatistics |
| pdpsubgroup |
| pdpsubgroup_pdp |
| toscacapabilityassignment |
| toscacapabilityassignments |
| toscacapabilityassignments_toscacapabilityassignment |
| toscacapabilitytype |
| toscacapabilitytypes |
| toscacapabilitytypes_toscacapabilitytype |
| toscadatatype |
| toscadatatypes |
| toscadatatypes_toscadatatype |
| toscanodetemplate |
| toscanodetemplates |
| toscanodetemplates_toscanodetemplate |
| toscanodetype |
| toscanodetypes |
| toscanodetypes_toscanodetype |
| toscaparameter |
| toscapolicies |
| toscapolicies_toscapolicy |
| toscapolicy |
| toscapolicytype |
| toscapolicytypes |
| toscapolicytypes_toscapolicytype |
| toscaproperty |
| toscarelationshiptype |
| toscarelationshiptypes |
| toscarelationshiptypes_toscarelationshiptype |
| toscarequirement |
| toscarequirements |
| toscarequirements_toscarequirement |
| toscaservicetemplate |
| toscatopologytemplate |
| toscatrigger |
+------------------------------------------------------+
73 rows in set (0.011 sec)
MariaDB [policyadmin]> use migration;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [migration]> show tables;
+----------------------------+
| Tables_in_migration |
+----------------------------+
| db_metadata_versions |
| metadata_versions |
| policyadmin_change_history |
| pooling_history |
+----------------------------+
4 rows in set (0.001 sec)
MariaDB [migration]> select * from policyadmin_change_history order by id asc;
+----+---------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
| ID | script | operation | from_version | to_version | tag | success | atTime
|
+----+---------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
| 1 | 0100-jpapdpstatistics_enginestats.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 2 | 0110-jpapdpstatistics_enginestats.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 3 | 0120-pdp.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 4 | 0130-idx_tsidx1.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:14 |
| 5 | 0140-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:16 |
| 6 | 0150-pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:17 |
| 7 | 0160-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 0 | 2021-08-19 14:50:17 |
+----+---------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
7 rows in set (0.728 sec)
Upgrade failed
Manual fix:
update pdpstatistics as p JOIN (select name, version, timeStamp, ROW_NUMBER() OVER (ORDER BY timeStamp ASC) AS row_num from pdpstatistics GROUP BY name, version, timeStamp) as t ON (p.name=t.name and p.version=t.version and p.timeStamp = t.timeStamp) set
p.id=t.row_num;
Deployment 2:
+ /opt/app/policy/bin/prepare_upgrade.sh policyadmin
278 blocks
Preparing upgrade release version: 0800
Preparing upgrade release version: 0900
Done
+ /opt/app/policy/bin/db-migrator -s policyadmin -o upgrade
upgrade: 0900 -> 0900
Partial upgrade detected
Upgrade will attempt to resume at 0160-pk_pdpstatistics.sql
> upgrade 0160-pk_pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version)
--------------
> upgrade 0170-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime NULL
--------------
> upgrade 0180-jpapolicyaudit.sql
--------------
CREATE TABLE IF NOT EXISTS jpapolicyaudit (ACTION INT DEFAULT NULL NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, TIMESTAMP datetime DEFAULT NULL NULL, USER VARCHAR(255) NULL, ID BIGINT NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_JPAPOLICYAUDIT PRIMARY KEY (ID, name, version))
--------------
> upgrade 0190-JpaPolicyAuditIndex_timestamp.sql
--------------
CREATE INDEX JpaPolicyAuditIndex_timestamp ON jpapolicyaudit(TIMESTAMP)
--------------
> upgrade 0200-sequence.sql
--------------
CREATE TABLE IF NOT EXISTS sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL NULL, CONSTRAINT PK_SEQUENCE PRIMARY KEY (SEQ_NAME))
--------------
> upgrade 0210-sequence.sql
--------------
INSERT INTO sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', 0)
--------------
policyadmin: OK: upgrade (0900)
+ /opt/app/policy/bin/db-migrator -s policyadmin -o report
name version
policyadmin 0900
ID script operation from_version to_version tag success atTime
1 0100-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
2 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
3 0120-pdp.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
4 0130-idx_tsidx1.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:14
5 0140-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:16
6 0150-pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:17
7 0160-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 0 2021-08-19 14:50:17
8 0160-pk_pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:25
9 0170-pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
10 0180-jpapolicyaudit.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
11 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
12 0200-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
13 0210-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
policyadmin: OK @ 0900
root@esy-master-policy-002-nfs:~/oom/kubernetes#
Downgrade test
Update oom/kubernetes/policy/resources/config/db_migrator_policy_init.sh
#!/bin/sh
## /opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800
## /opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade
/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report
MariaDB [migration]> select * from policyadmin_change_history order by id asc;
+----+----------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
| ID | script | operation | from_version | to_version | tag | success | atTime
|
+----+----------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
| 1 | 0100-jpapdpstatistics_enginestats.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 2 | 0110-jpapdpstatistics_enginestats.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 3 | 0120-pdp.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 4 | 0130-idx_tsidx1.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:14 |
| 5 | 0140-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:16 |
| 6 | 0150-pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:17 |
| 7 | 0160-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 0 | 2021-08-19 14:50:17 |
| 8 | 0160-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:25 |
| 9 | 0170-pdpstatistics.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:26 |
| 10 | 0180-jpapolicyaudit.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:26 |
| 11 | 0190-JpaPolicyAuditIndex_timestamp.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:27 |
| 12 | 0200-sequence.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:27 |
| 13 | 0210-sequence.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:27 |
| 14 | 0210-sequence.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 15 | 0200-sequence.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 16 | 0190-JpaPolicyAuditIndex_timestamp.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 17 | 0180-jpapolicyaudit.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 18 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 19 | 0160-pk_pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:49 |
| 20 | 0150-pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:50 |
| 21 | 0140-pk_pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:50 |
| 22 | 0130-idx_tsidx1.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:51 |
| 23 | 0120-pdp.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:51 |
| 24 | 0110-jpapdpstatistics_enginestats.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:51 |
| 25 | 0100-jpapdpstatistics_enginestats.sql | downgrade | 0900 | 0800 | 2308211655460900d | 0 | 2021-08-23 16:55:51 |
+----+----------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
25 rows in set (0.070 sec)
MariaDB [policyadmin]> select count(1) from pdpstatistics;
+----------+
| count(1) |
+----------+
| 24767 |
+----------+
1 row in set (0.100 sec)
MariaDB [policyadmin]> select max(timeStamp) from pdpstatistics;
+---------------------+
| max(timeStamp) |
+---------------------+
| 2021-08-19 11:50:07 |
+---------------------+
1 row in set (0.453 sec)
Run upgrade again
Update shell script:
root@esy-master-policy-002-nfs:~/oom/kubernetes# cat policy/resources/config/db_migrator_policy_init.sh
#!/bin/sh
/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
#/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
#/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800
/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade
rc=$?
/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report
exit $rc
Update values.yaml
#################################################################
# DB configuration defaults.
#################################################################
repository: nexus3.onap.org:10001
pullPolicy: Always
mariadb:
image: mariadb:10.5.8
dbmigrator:
image: onap/policy-db-migrator
schema: policyadmin
policy_home: "/opt/app/policy"
subChartsOnly:
enabled: true
Re-deploy:
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl logs dev-policy-galera-config-5z8c9
+ /opt/app/policy/bin/prepare_upgrade.sh policyadmin
279 blocks
+ /opt/app/policy/bin/db-migrator -s policyadmin -o upgrade
Preparing upgrade release version: 0800
Preparing upgrade release version: 0900
Done
upgrade: 0900 -> 0900
Partial downgrade detected
Upgrade will attempt to resume after 0100-jpapdpstatistics_enginestats.sql
> upgrade 0110-jpapdpstatistics_enginestats.sql
--------------
ALTER TABLE jpapdpstatistics_enginestats ADD COLUMN ID BIGINT DEFAULT NULL NULL AFTER UPTIME
--------------
> upgrade 0120-pdp.sql
--------------
ALTER TABLE pdp ADD COLUMN LASTUPDATE datetime DEFAULT NULL NULL AFTER HEALTHY
--------------
> upgrade 0130-idx_tsidx1.sql
--------------
CREATE INDEX IDX_TSIDX1 ON pdpstatistics(timeStamp, name, version)
--------------
> upgrade 0140-pk_pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics DROP PRIMARY KEY
--------------
> upgrade 0150-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics ADD COLUMN POLICYUNDEPLOYCOUNT BIGINT DEFAULT NULL NULL AFTER POLICYEXECUTEDSUCCESSCOUNT, ADD COLUMN POLICYUNDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN POLICYUNDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN ID BIGINT NOT NULL
--------------
> upgrade 0160-pk_pdpstatistics.sql
--------------
UPDATE pdpstatistics as p JOIN (SELECT name, version, timeStamp, ROW_NUMBER() OVER (ORDER BY timeStamp ASC) AS row_num FROM pdpstatistics GROUP BY name, version, timeStamp) AS t ON (p.name=t.name AND p.version=t.version AND p.timeStamp = t.timeStamp) SET p.id=t.row_num
--------------
--------------
ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version)
--------------
> upgrade 0170-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime NULL
--------------
> upgrade 0180-jpapolicyaudit.sql
--------------
CREATE TABLE IF NOT EXISTS jpapolicyaudit (ACTION INT DEFAULT NULL NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, TIMESTAMP datetime DEFAULT NULL NULL, USER VARCHAR(255) NULL, ID BIGINT NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_JPAPOLICYAUDIT PRIMARY KEY (ID, name, version))
--------------
> upgrade 0190-JpaPolicyAuditIndex_timestamp.sql
--------------
CREATE INDEX JpaPolicyAuditIndex_timestamp ON jpapolicyaudit(TIMESTAMP)
--------------
> upgrade 0200-sequence.sql
--------------
CREATE TABLE IF NOT EXISTS sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL NULL, CONSTRAINT PK_SEQUENCE PRIMARY KEY (SEQ_NAME))
--------------
> upgrade 0210-sequence.sql
--------------
INSERT INTO sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', (SELECT IFNULL(max(id),0) FROM pdpstatistics))
--------------
policyadmin: OK: upgrade (0900)
+ rc=0
+ /opt/app/policy/bin/db-migrator -s policyadmin -o report
name version
policyadmin 0900
ID script operation from_version to_version tag success atTime
1 0100-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
2 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
3 0120-pdp.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
4 0130-idx_tsidx1.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:14
5 0140-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:16
6 0150-pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:17
7 0160-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 0 2021-08-19 14:50:17
8 0160-pk_pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:25
9 0170-pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
10 0180-jpapolicyaudit.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
11 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
12 0200-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
13 0210-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
14 0210-sequence.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
15 0200-sequence.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
16 0190-JpaPolicyAuditIndex_timestamp.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
17 0180-jpapolicyaudit.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
18 0170-pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
19 0160-pk_pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:49
20 0150-pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:50
21 0140-pk_pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:50
22 0130-idx_tsidx1.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
23 0120-pdp.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
24 0110-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
25 0100-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2308211655460900d 0 2021-08-23 16:55:51
26 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
27 0120-pdp.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
28 0130-idx_tsidx1.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
29 0140-pk_pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:38
30 0150-pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:38
31 0160-pk_pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:41
32 0170-pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
33 0180-jpapolicyaudit.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
34 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
35 0200-sequence.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
36 0210-sequence.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
policyadmin: OK @ 0900
+ exit 0
Database changed
MariaDB [policyadmin]> select max(id) from pdpstatistics;
+---------+
| max(id) |
+---------+
| 24767 |
+---------+
1 row in set (0.013 sec)
MariaDB [policyadmin]> select count(1) from pdpstatistics;
+----------+
| count(1) |
+----------+
| 24767 |
+----------+
1 row in set (0.224 sec)
Test DB initialization
Update db.sh with an additional test schema to ensure it has run:
root@esy-master-policy-002-nfs:~/oom/kubernetes# cat policy/resources/config/db.sh
#!/bin/sh
{{/*
# Copyright © 2017 Amdocs, Bell Canada, AT&T
# Modifications Copyright © 2018, 2020 AT&T Intellectual Property
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*/}}
mysql() { /usr/bin/mysql -h ${MYSQL_HOST} -P ${MYSQL_USER} "$@"; };
for db in support onap_sdk log migration operationshistory10 pooling policyadmin policyclamp operationshistory testschema
do
mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
done
mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"
login to mariadb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 254
Server version: 10.5.8-MariaDB-log Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+---------------------+
| Database |
+---------------------+
| information_schema |
| log |
| migration |
| onap_sdk |
| operationshistory |
| operationshistory10 |
| policyadmin |
| policyclamp |
| pooling |
| support |
| test |
| testschema |
+---------------------+
12 rows in set (0.006 sec)
MariaDB [(none)]> use testschema;
Database changed
policyadmin schema remains unchanged:
+ /opt/app/policy/bin/db-migrator -s policyadmin -o upgrade
upgrade: 0900 -> 0900
policyadmin: OK: upgrade (0900)
+ rc=0
Test Upgrade/downgrade when pdpstatistics is not present
Rename pdpstatistics table;
https://mariadb.com/kb/en/rename-table/
RENAME TABLE pdpstatistics to backup_pdpstatistics;
dev-policy-galera-config-grt2f 0/1 Error 0 102s
dev-policy-galera-config-pq2kb 0/1 Error 0 2m17s
dev-policy-galera-config-sp7zg 0/1 Error 0 4m45s
dev-policy-galera-config-t9c6x 0/1 Error 0 61s
dev-policy-mariadb-0 2/2 Running 0 4m46s
dev-policy-pap-65ddfc8f54-4fql4 0/1 Init:0/4 0 4m46s
dev-policy-xacml-pdp-d7dfc9964-gnfpc 0/1 Init:0/4 0 4m46s
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl logs dev-policy-galera-config-t9c6x
+ /opt/app/policy/bin/prepare_downgrade.sh policyadmin
239 blocks
Preparing downgrade release version: 0800
Preparing downgrade release version: 0900
Done
+ /opt/app/policy/bin/db-migrator -s policyadmin -o downgrade -f 0900 -t 0800
downgrade: 0900 -> 0800
Partial downgrade detected
Downgrade will attempt to resume at 0170-pdpstatistics.sql
> downgrade 0170-pdpstatistics.sql
--------------
ERROR 1146 (42S02) at line 20: Table 'policyadmin.pdpstatistics' doesn't exist
ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime NOT NULL
--------------
policyadmin: downgrade aborted at 0900 by script 0170-pdpstatistics.sql
policyadmin: failure: downgrade to release 0800 (0900)
+ rc=1
+ /opt/app/policy/bin/db-migrator -s policyadmin -o report
name version
policyadmin 0900
ID script operation from_version to_version tag success atTime
1 0100-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
2 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
3 0120-pdp.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
4 0130-idx_tsidx1.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:14
5 0140-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:16
6 0150-pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:17
7 0160-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 0 2021-08-19 14:50:17
8 0160-pk_pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:25
9 0170-pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
10 0180-jpapolicyaudit.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
11 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
12 0200-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
13 0210-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
14 0210-sequence.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
15 0200-sequence.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
16 0190-JpaPolicyAuditIndex_timestamp.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
17 0180-jpapolicyaudit.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
18 0170-pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
19 0160-pk_pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:49
20 0150-pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:50
21 0140-pk_pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:50
22 0130-idx_tsidx1.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
23 0120-pdp.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
24 0110-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
25 0100-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2308211655460900d 0 2021-08-23 16:55:51
26 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
27 0120-pdp.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
28 0130-idx_tsidx1.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
29 0140-pk_pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:38
30 0150-pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:38
31 0160-pk_pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:41
32 0170-pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
33 0180-jpapolicyaudit.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
34 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
35 0200-sequence.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
36 0210-sequence.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
37 0210-sequence.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:15
38 0200-sequence.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:15
39 0190-JpaPolicyAuditIndex_timestamp.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:16
40 0180-jpapolicyaudit.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:16
41 0170-pdpstatistics.sql downgrade 0900 0800 2408211341150900d 0 2021-08-24 13:41:16
42 0170-pdpstatistics.sql downgrade 0900 0800 2408211341310900d 0 2021-08-24 13:41:31
43 0170-pdpstatistics.sql downgrade 0900 0800 2408211342050900d 0 2021-08-24 13:42:05
44 0170-pdpstatistics.sql downgrade 0900 0800 2408211342440900d 0 2021-08-24 13:42:44
+ exit 1
policyadmin: downgrade available: 0900 -> 0
Downgrade completes on re-try but is unsuccessful due to updates from pap and api components
MariaDB [migration]> select * from policyadmin_change_history order by id asc;
+----+----------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
| ID | script | operation | from_version | to_version | tag | success | atTime
|
+----+----------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
| 1 | 0100-jpapdpstatistics_enginestats.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 2 | 0110-jpapdpstatistics_enginestats.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 3 | 0120-pdp.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:13 |
| 4 | 0130-idx_tsidx1.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:14 |
| 5 | 0140-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:16 |
| 6 | 0150-pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 1 | 2021-08-19 14:50:17 |
| 7 | 0160-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 1908211450100900u | 0 | 2021-08-19 14:50:17 |
| 8 | 0160-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:25 |
| 9 | 0170-pdpstatistics.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:26 |
| 10 | 0180-jpapolicyaudit.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:26 |
| 11 | 0190-JpaPolicyAuditIndex_timestamp.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:27 |
| 12 | 0200-sequence.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:27 |
| 13 | 0210-sequence.sql | upgrade | 0800 | 0900 | 2008211234230900u | 1 | 2021-08-20 12:34:27 |
| 14 | 0210-sequence.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 15 | 0200-sequence.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 16 | 0190-JpaPolicyAuditIndex_timestamp.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 17 | 0180-jpapolicyaudit.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 18 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:47 |
| 19 | 0160-pk_pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:49 |
| 20 | 0150-pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:50 |
| 21 | 0140-pk_pdpstatistics.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:50 |
| 22 | 0130-idx_tsidx1.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:51 |
| 23 | 0120-pdp.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:51 |
| 24 | 0110-jpapdpstatistics_enginestats.sql | downgrade | 0900 | 0800 | 2308211655460900d | 1 | 2021-08-23 16:55:51 |
| 25 | 0100-jpapdpstatistics_enginestats.sql | downgrade | 0900 | 0800 | 2308211655460900d | 0 | 2021-08-23 16:55:51 |
| 26 | 0110-jpapdpstatistics_enginestats.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:37 |
| 27 | 0120-pdp.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:37 |
| 28 | 0130-idx_tsidx1.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:37 |
| 29 | 0140-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:38 |
| 30 | 0150-pdpstatistics.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:38 |
| 31 | 0160-pk_pdpstatistics.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:41 |
| 32 | 0170-pdpstatistics.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:42 |
| 33 | 0180-jpapolicyaudit.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:42 |
| 34 | 0190-JpaPolicyAuditIndex_timestamp.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:42 |
| 35 | 0200-sequence.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:42 |
| 36 | 0210-sequence.sql | upgrade | 0800 | 0900 | 2408210814360900u | 1 | 2021-08-24 08:14:42 |
| 37 | 0210-sequence.sql | downgrade | 0900 | 0800 | 2408211341150900d | 1 | 2021-08-24 13:41:15 |
| 38 | 0200-sequence.sql | downgrade | 0900 | 0800 | 2408211341150900d | 1 | 2021-08-24 13:41:15 |
| 39 | 0190-JpaPolicyAuditIndex_timestamp.sql | downgrade | 0900 | 0800 | 2408211341150900d | 1 | 2021-08-24 13:41:16 |
| 40 | 0180-jpapolicyaudit.sql | downgrade | 0900 | 0800 | 2408211341150900d | 1 | 2021-08-24 13:41:16 |
| 41 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211341150900d | 0 | 2021-08-24 13:41:16 |
| 42 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211341310900d | 0 | 2021-08-24 13:41:31 |
| 43 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211342050900d | 0 | 2021-08-24 13:42:05 |
| 44 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211342440900d | 0 | 2021-08-24 13:42:44 |
| 45 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211344040900d | 0 | 2021-08-24 13:44:04 |
| 46 | 0170-pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211346450900d | 1 | 2021-08-24 13:46:45 |
| 47 | 0160-pk_pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211346450900d | 1 | 2021-08-24 13:46:47 |
| 48 | 0150-pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211346450900d | 1 | 2021-08-24 13:46:48 |
| 49 | 0140-pk_pdpstatistics.sql | downgrade | 0900 | 0800 | 2408211346450900d | 1 | 2021-08-24 13:46:48 |
| 50 | 0130-idx_tsidx1.sql | downgrade | 0900 | 0800 | 2408211346450900d | 1 | 2021-08-24 13:46:48 |
| 51 | 0120-pdp.sql | downgrade | 0900 | 0800 | 2408211346450900d | 1 | 2021-08-24 13:46:48 |
| 52 | 0110-jpapdpstatistics_enginestats.sql | downgrade | 0900 | 0800 | 2408211346450900d | 1 | 2021-08-24 13:46:48 |
| 53 | 0100-jpapdpstatistics_enginestats.sql | downgrade | 0900 | 0800 | 2408211346450900d | 0 | 2021-08-24 13:4
6:48 |
+----+----------------------------------------+-----------+--------------+------------+-------------------+---------+---------------------+
53 rows in set (0.889 sec)
Update migration tables so reflect correct downgrade status:
MariaDB [migration]> update policyadmin_change_history set success=1 where id=53;
Query OK, 1 row affected (0.270 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [migration]> commit;
Query OK, 0 rows affected (0.000 sec)
MariaDB [migration]> select * from db_metadata_versions;
+-------------+---------+
| name | version |
+-------------+---------+
| policyadmin | 0900 |
+-------------+---------+
1 row in set (0.471 sec)
MariaDB [migration]> update db_metadata_versions set version = '0800';
Query OK, 1 row affected (0.402 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [migration]> commit;
Query OK, 0 rows affected (0.001 sec)
Run upgrade followed by downgrade
root@esy-master-policy-002-nfs:~/oom/kubernetes# cat policy/resources/config/db_migrator_policy_init.sh
#!/bin/sh
/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade
/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 0900 -t 0800
rc=$?
/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report
exit $rc
dev-policy-galera-config-6jwpk 0/1 Completed 0 4m3s
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl logs dev-policy-galera-config-6jwpk
+ /opt/app/policy/bin/prepare_upgrade.sh policyadmin
279 blocks
Preparing upgrade release version: 0800
Preparing upgrade release version: 0900
Done
+ /opt/app/policy/bin/db-migrator -s policyadmin -o upgrade
upgrade: 0800 -> 0900
> upgrade 0100-jpapdpstatistics_enginestats.sql
--------------
ALTER TABLE jpapdpstatistics_enginestats DROP COLUMN timeStamp
--------------
> upgrade 0110-jpapdpstatistics_enginestats.sql
--------------
ALTER TABLE jpapdpstatistics_enginestats ADD COLUMN ID BIGINT DEFAULT NULL NULL AFTER UPTIME
--------------
> upgrade 0120-pdp.sql
--------------
ALTER TABLE pdp ADD COLUMN LASTUPDATE datetime DEFAULT NULL NULL AFTER HEALTHY
--------------
> upgrade 0130-idx_tsidx1.sql
--------------
CREATE INDEX IDX_TSIDX1 ON pdpstatistics(timeStamp, name, version)
--------------
> upgrade 0140-pk_pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics DROP PRIMARY KEY
--------------
> upgrade 0150-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics ADD COLUMN POLICYUNDEPLOYCOUNT BIGINT DEFAULT NULL NULL AFTER POLICYEXECUTEDSUCCESSCOUNT, ADD COLUMN POLICYUNDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN POLICYUNDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN ID BIGINT NOT NULL
--------------
> upgrade 0160-pk_pdpstatistics.sql
--------------
UPDATE pdpstatistics as p JOIN (SELECT name, version, timeStamp, ROW_NUMBER() OVER (ORDER BY timeStamp ASC) AS row_num FROM pdpstatistics GROUP BY name, version, timeStamp) AS t ON (p.name=t.name AND p.version=t.version AND p.timeStamp = t.timeStamp) SET p.id=t.row_num
--------------
--------------
ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version)
--------------
> upgrade 0170-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime NULL
--------------
> upgrade 0180-jpapolicyaudit.sql
--------------
CREATE TABLE IF NOT EXISTS jpapolicyaudit (ACTION INT DEFAULT NULL NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, TIMESTAMP datetime DEFAULT NULL NULL, USER VARCHAR(255) NULL, ID BIGINT NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_JPAPOLICYAUDIT PRIMARY KEY (ID, name, version))
--------------
> upgrade 0190-JpaPolicyAuditIndex_timestamp.sql
--------------
CREATE INDEX JpaPolicyAuditIndex_timestamp ON jpapolicyaudit(TIMESTAMP)
--------------
> upgrade 0200-sequence.sql
--------------
CREATE TABLE IF NOT EXISTS sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL NULL, CONSTRAINT PK_SEQUENCE PRIMARY KEY (SEQ_NAME))
--------------
> upgrade 0210-sequence.sql
--------------
INSERT INTO sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', (SELECT IFNULL(max(id),0) FROM pdpstatistics))
--------------
policyadmin: OK: upgrade (0900)
+ /opt/app/policy/bin/prepare_downgrade.sh policyadmin
239 blocks
Preparing downgrade release version: 0800
Preparing downgrade release version: 0900
Done
+ /opt/app/policy/bin/db-migrator -s policyadmin -o downgrade -f 0900 -t 0800
downgrade: 0900 -> 0800
> downgrade 0210-sequence.sql
--------------
DELETE from sequence
--------------
> downgrade 0200-sequence.sql
--------------
DROP TABLE IF EXISTS `sequence`
--------------
> downgrade 0190-JpaPolicyAuditIndex_timestamp.sql
--------------
ALTER TABLE jpapolicyaudit DROP INDEX JpaPolicyAuditIndex_timestamp
--------------
> downgrade 0180-jpapolicyaudit.sql
--------------
DROP TABLE IF EXISTS `jpapolicyaudit`
--------------
> downgrade 0170-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime NOT NULL
--------------
> downgrade 0160-pk_pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics DROP CONSTRAINT PRIMARY KEY
--------------
--------------
UPDATE pdpstatistics set ID = 0
--------------
> downgrade 0150-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics DROP COLUMN POLICYUNDEPLOYCOUNT, DROP COLUMN POLICYUNDEPLOYFAILCOUNT, DROP COLUMN POLICYUNDEPLOYSUCCESSCOUNT, DROP COLUMN ID
--------------
> downgrade 0140-pk_pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (timeStamp, name, version)
--------------
> downgrade 0130-idx_tsidx1.sql
--------------
DROP INDEX IDX_TSIDX1 ON pdpstatistics
--------------
> downgrade 0120-pdp.sql
--------------
ALTER TABLE pdp DROP COLUMN LASTUPDATE
--------------
> downgrade 0110-jpapdpstatistics_enginestats.sql
--------------
ALTER TABLE jpapdpstatistics_enginestats DROP COLUMN ID
--------------
> downgrade 0100-jpapdpstatistics_enginestats.sql
--------------
ALTER TABLE jpapdpstatistics_enginestats ADD COLUMN timeStamp datetime DEFAULT NULL NULL AFTER UPTIME
--------------
policyadmin: OK: downgrade (0800)
+ rc=0
+ /opt/app/policy/bin/db-migrator -s policyadmin -o report
name version
policyadmin 0800
ID script operation from_version to_version tag success atTime
1 0100-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
2 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
3 0120-pdp.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:13
4 0130-idx_tsidx1.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:14
5 0140-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:16
6 0150-pdpstatistics.sql upgrade 0800 0900 1908211450100900u 1 2021-08-19 14:50:17
7 0160-pk_pdpstatistics.sql upgrade 0800 0900 1908211450100900u 0 2021-08-19 14:50:17
8 0160-pk_pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:25
9 0170-pdpstatistics.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
10 0180-jpapolicyaudit.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:26
11 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
12 0200-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
13 0210-sequence.sql upgrade 0800 0900 2008211234230900u 1 2021-08-20 12:34:27
14 0210-sequence.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
15 0200-sequence.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
16 0190-JpaPolicyAuditIndex_timestamp.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
17 0180-jpapolicyaudit.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
18 0170-pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:47
19 0160-pk_pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:49
20 0150-pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:50
21 0140-pk_pdpstatistics.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:50
22 0130-idx_tsidx1.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
23 0120-pdp.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
24 0110-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2308211655460900d 1 2021-08-23 16:55:51
25 0100-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2308211655460900d 0 2021-08-23 16:55:51
26 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
27 0120-pdp.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
28 0130-idx_tsidx1.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:37
29 0140-pk_pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:38
30 0150-pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:38
31 0160-pk_pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:41
32 0170-pdpstatistics.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
33 0180-jpapolicyaudit.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
34 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
35 0200-sequence.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
36 0210-sequence.sql upgrade 0800 0900 2408210814360900u 1 2021-08-24 08:14:42
37 0210-sequence.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:15
38 0200-sequence.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:15
39 0190-JpaPolicyAuditIndex_timestamp.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:16
40 0180-jpapolicyaudit.sql downgrade 0900 0800 2408211341150900d 1 2021-08-24 13:41:16
41 0170-pdpstatistics.sql downgrade 0900 0800 2408211341150900d 0 2021-08-24 13:41:16
42 0170-pdpstatistics.sql downgrade 0900 0800 2408211341310900d 0 2021-08-24 13:41:31
43 0170-pdpstatistics.sql downgrade 0900 0800 2408211342050900d 0 2021-08-24 13:42:05
44 0170-pdpstatistics.sql downgrade 0900 0800 2408211342440900d 0 2021-08-24 13:42:44
45 0170-pdpstatistics.sql downgrade 0900 0800 2408211344040900d 0 2021-08-24 13:44:04
46 0170-pdpstatistics.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 13:46:45
47 0160-pk_pdpstatistics.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 13:46:47
48 0150-pdpstatistics.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 13:46:48
49 0140-pk_pdpstatistics.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 13:46:48
50 0130-idx_tsidx1.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 13:46:48
51 0120-pdp.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 13:46:48
52 0110-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 13:46:48
53 0100-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2408211346450900d 1 2021-08-24 14:21:09
54 0100-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:05
55 0110-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:05
56 0120-pdp.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:05
57 0130-idx_tsidx1.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:05
58 0140-pk_pdpstatistics.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:06
59 0150-pdpstatistics.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:06
60 0160-pk_pdpstatistics.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:09
61 0170-pdpstatistics.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:09
62 0180-jpapolicyaudit.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:09
63 0190-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:09
64 0200-sequence.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:09
65 0210-sequence.sql upgrade 0800 0900 2408211435040900u 1 2021-08-24 14:35:09
66 0210-sequence.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:10
67 0200-sequence.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:10
68 0190-JpaPolicyAuditIndex_timestamp.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:10
69 0180-jpapolicyaudit.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:10
70 0170-pdpstatistics.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:10
71 0160-pk_pdpstatistics.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:12
72 0150-pdpstatistics.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:12
73 0140-pk_pdpstatistics.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:12
74 0130-idx_tsidx1.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:13
75 0120-pdp.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:14
76 0110-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:15
77 0100-jpapdpstatistics_enginestats.sql downgrade 0900 0800 2408211435100900d 1 2021-08-24 14:35:15
policyadmin: downgrade available: 0800 -> 0
+ exit 0
Fresh Install Test
Moved /dockerdata-nfs/dev/policy/ to /dockerdata-nfs/dev/policy-old
Downeloaded files from https://gerrit.onap.org/r/c/oom/+/120577 and overwrote existing files.
Redeployed dev-policy
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl get pods | grep policy
dev-policy-apex-pdp-0 0/1 Init:1/3 3 3m22s
dev-policy-api-78976fbd5d-pbk4h 0/1 Init:2/4 1 3m23s
dev-policy-clamp-be-5c6cb758d8-hgf8w 0/1 Init:1/3 1 3m23s
dev-policy-clamp-fe-569494fb5d-5qfkr 0/1 Init:0/3 0 3m23s
dev-policy-clamp-galera-config-5g2kb 0/1 Completed 0 3m22s
dev-policy-distribution-7dfdfbd64c-lzj46 0/1 Init:1/3 3 3m23s
dev-policy-drools-pdp-0 0/1 Init:1/3 1 3m22s
dev-policy-galera-config-xg8nl 0/1 Completed 0 3m22s
dev-policy-mariadb-0 2/2 Running 0 3m23s
dev-policy-pap-7899b7f9fb-x6pf8 0/1 Init:2/4 1 3m23s
dev-policy-xacml-pdp-68f589ccc4-xmv6h 0/1 Init:2/4 1 3m23s
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl logs dev-policy-galera-config-xg8nl
+ /opt/app/policy/bin/prepare_upgrade.sh policyadmin
281 blocks
Preparing upgrade release version: 0800
Preparing upgrade release version: 0900
Done
+ /opt/app/policy/bin/db-migrator -s policyadmin -o upgrade
upgrade: 0 -> 0900
> upgrade 0100-jpapdpgroup_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpapdpgroup_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES VARCHAR(255) NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0110-jpapdpstatistics_enginestats.sql
--------------
CREATE TABLE IF NOT EXISTS jpapdpstatistics_enginestats (AVERAGEEXECUTIONTIME DOUBLE DEFAULT NULL NULL, ENGINEID VARCHAR(255) NULL, ENGINETIMESTAMP BIGINT DEFAULT NULL NULL, ENGINEWORKERSTATE INT DEFAULT NULL NULL, EVENTCOUNT BIGINT DEFAULT NULL NULL, LASTENTERTIME BIGINT DEFAULT NULL NULL, LASTEXECUTIONTIME BIGINT DEFAULT NULL NULL, LASTSTART BIGINT DEFAULT NULL NULL, UPTIME BIGINT DEFAULT NULL NULL, timeStamp datetime DEFAULT NULL NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL)
--------------
> upgrade 0120-jpapdpsubgroup_policies.sql
--------------
CREATE TABLE IF NOT EXISTS jpapdpsubgroup_policies (name VARCHAR(120) NULL, version VARCHAR(20) NULL, parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL)
--------------
> upgrade 0130-jpapdpsubgroup_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpapdpsubgroup_properties (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, PROPERTIES VARCHAR(255) NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0140-jpapdpsubgroup_supportedpolicytypes.sql
--------------
CREATE TABLE IF NOT EXISTS jpapdpsubgroup_supportedpolicytypes (name VARCHAR(120) NULL, version VARCHAR(20) NULL, parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL)
--------------
> upgrade 0150-jpatoscacapabilityassignment_attributes.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_attributes (name VARCHAR(120) NULL, version VARCHAR(20) NULL, ATTRIBUTES LONGTEXT NULL, ATTRIBUTES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0160-jpatoscacapabilityassignment_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0170-jpatoscacapabilityassignment_occurrences.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_occurrences (name VARCHAR(120) NULL, version VARCHAR(20) NULL, OCCURRENCES INT DEFAULT NULL NULL)
--------------
> upgrade 0180-jpatoscacapabilityassignment_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscacapabilityassignment_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0190-jpatoscacapabilitytype_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscacapabilitytype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0200-jpatoscacapabilitytype_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscacapabilitytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0210-jpatoscadatatype_constraints.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscadatatype_constraints (name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINTS VARCHAR(255) NULL)
--------------
> upgrade 0220-jpatoscadatatype_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscadatatype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0230-jpatoscadatatype_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscadatatype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0240-jpatoscanodetemplate_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscanodetemplate_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0250-jpatoscanodetemplate_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscanodetemplate_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0260-jpatoscanodetype_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscanodetype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0270-jpatoscanodetype_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscanodetype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0280-jpatoscapolicy_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscapolicy_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0290-jpatoscapolicy_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscapolicy_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0300-jpatoscapolicy_targets.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscapolicy_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL)
--------------
> upgrade 0310-jpatoscapolicytype_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscapolicytype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0320-jpatoscapolicytype_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscapolicytype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0330-jpatoscapolicytype_targets.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscapolicytype_targets (name VARCHAR(120) NULL, version VARCHAR(20) NULL)
--------------
> upgrade 0340-jpatoscapolicytype_triggers.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscapolicytype_triggers (name VARCHAR(120) NULL, version VARCHAR(20) NULL, TRIGGERS VARCHAR(255) NULL)
--------------
> upgrade 0350-jpatoscaproperty_constraints.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscaproperty_constraints (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, CONSTRAINTS VARCHAR(255) NULL)
--------------
> upgrade 0360-jpatoscaproperty_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscaproperty_metadata (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0370-jpatoscarelationshiptype_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscarelationshiptype_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0380-jpatoscarelationshiptype_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscarelationshiptype_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGBLOB DEFAULT NULL NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0390-jpatoscarequirement_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscarequirement_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0400-jpatoscarequirement_occurrences.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscarequirement_occurrences (name VARCHAR(120) NULL, version VARCHAR(20) NULL, OCCURRENCES INT DEFAULT NULL NULL)
--------------
> upgrade 0410-jpatoscarequirement_properties.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscarequirement_properties (name VARCHAR(120) NULL, version VARCHAR(20) NULL, PROPERTIES LONGTEXT NULL, PROPERTIES_KEY VARCHAR(255) NULL)
--------------
> upgrade 0420-jpatoscaservicetemplate_metadata.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscaservicetemplate_metadata (name VARCHAR(120) NULL, version VARCHAR(20) NULL, METADATA VARCHAR(255) NULL, METADATA_KEY VARCHAR(255) NULL)
--------------
> upgrade 0430-jpatoscatopologytemplate_inputs.sql
--------------
CREATE TABLE IF NOT EXISTS jpatoscatopologytemplate_inputs (parentLocalName VARCHAR(120) NULL, localName VARCHAR(120) NULL, parentKeyVersion VARCHAR(15) NULL, parentKeyName VARCHAR(120) NULL, INPUTS LONGBLOB DEFAULT NULL NULL, INPUTS_KEY VARCHAR(255) NULL)
--------------
> upgrade 0440-pdpgroup_pdpsubgroup.sql
--------------
CREATE TABLE IF NOT EXISTS pdpgroup_pdpsubgroup (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDPGROUP_PDPSUBGROUP PRIMARY KEY (name, version, parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0450-pdpgroup.sql
--------------
CREATE TABLE IF NOT EXISTS pdpgroup (`DESCRIPTION` VARCHAR(255) NULL, PDPGROUPSTATE INT DEFAULT NULL NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_PDPGROUP PRIMARY KEY (name, version))
--------------
> upgrade 0460-pdppolicystatus.sql
--------------
CREATE TABLE IF NOT EXISTS pdppolicystatus (DEPLOY BIT DEFAULT 0 NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, STATE INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_PDPPOLICYSTATUS PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0470-pdp.sql
--------------
CREATE TABLE IF NOT EXISTS pdp (HEALTHY INT DEFAULT NULL NULL, MESSAGE VARCHAR(255) NULL, PDPSTATE INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDP PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0480-pdpstatistics.sql
--------------
CREATE TABLE IF NOT EXISTS pdpstatistics (PDPGROUPNAME VARCHAR(120) NULL, PDPSUBGROUPNAME VARCHAR(120) NULL, POLICYDEPLOYCOUNT BIGINT DEFAULT NULL NULL, POLICYDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, POLICYDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, POLICYEXECUTEDCOUNT BIGINT DEFAULT NULL NULL, POLICYEXECUTEDFAILCOUNT BIGINT DEFAULT NULL NULL, POLICYEXECUTEDSUCCESSCOUNT BIGINT DEFAULT NULL NULL, timeStamp datetime NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (timeStamp, name, version))
--------------
> upgrade 0490-pdpsubgroup_pdp.sql
--------------
CREATE TABLE IF NOT EXISTS pdpsubgroup_pdp (pdpParentKeyName VARCHAR(120) NOT NULL, pdpParentKeyVersion VARCHAR(15) NOT NULL, pdpParentLocalName VARCHAR(120) NOT NULL, pdpLocalName VARCHAR(120) NOT NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDPSUBGROUP_PDP PRIMARY KEY (pdpParentKeyName, pdpParentKeyVersion, pdpParentLocalName, pdpLocalName, parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0500-pdpsubgroup.sql
--------------
CREATE TABLE IF NOT EXISTS pdpsubgroup (CURRENTINSTANCECOUNT INT DEFAULT NULL NULL, DESIREDINSTANCECOUNT INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_PDPSUBGROUP PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0510-toscacapabilityassignment.sql
--------------
CREATE TABLE IF NOT EXISTS toscacapabilityassignment (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, CONSTRAINT PK_TOSCACAPABILITYASSIGNMENT PRIMARY KEY (name, version))
--------------
> upgrade 0520-toscacapabilityassignments.sql
--------------
CREATE TABLE IF NOT EXISTS toscacapabilityassignments (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCACAPABILITYASSIGNMENTS PRIMARY KEY (name, version))
--------------
> upgrade 0530-toscacapabilityassignments_toscacapabilityassignment.sql
--------------
CREATE TABLE IF NOT EXISTS toscacapabilityassignments_toscacapabilityassignment (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCACAPABILITYASSIGNMENTS_TOSCACAPABILITYASSIGNMENT PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0540-toscacapabilitytype.sql
--------------
CREATE TABLE IF NOT EXISTS toscacapabilitytype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCACAPABILITYTYPE PRIMARY KEY (name, version))
--------------
> upgrade 0550-toscacapabilitytypes.sql
--------------
CREATE TABLE IF NOT EXISTS toscacapabilitytypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCACAPABILITYTYPES PRIMARY KEY (name, version))
--------------
> upgrade 0560-toscacapabilitytypes_toscacapabilitytype.sql
--------------
CREATE TABLE IF NOT EXISTS toscacapabilitytypes_toscacapabilitytype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCACAPABILITYTYPES_TOSCACAPABILITYTYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0570-toscadatatype.sql
--------------
CREATE TABLE IF NOT EXISTS toscadatatype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCADATATYPE PRIMARY KEY (name, version))
--------------
> upgrade 0580-toscadatatypes.sql
--------------
CREATE TABLE IF NOT EXISTS toscadatatypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCADATATYPES PRIMARY KEY (name, version))
--------------
> upgrade 0590-toscadatatypes_toscadatatype.sql
--------------
CREATE TABLE IF NOT EXISTS toscadatatypes_toscadatatype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCADATATYPES_TOSCADATATYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0600-toscanodetemplate.sql
--------------
CREATE TABLE IF NOT EXISTS toscanodetemplate (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, capabilitiesName VARCHAR(120) NULL, capabilitiesVersion VARCHAR(20) NULL, requirementsVersion VARCHAR(20) NULL, requirementsName VARCHAR(120) NULL, CONSTRAINT PK_TOSCANODETEMPLATE PRIMARY KEY (name, version))
--------------
> upgrade 0610-toscanodetemplates.sql
--------------
CREATE TABLE IF NOT EXISTS toscanodetemplates (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCANODETEMPLATES PRIMARY KEY (name, version))
--------------
> upgrade 0620-toscanodetemplates_toscanodetemplate.sql
--------------
CREATE TABLE IF NOT EXISTS toscanodetemplates_toscanodetemplate (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCANODETEMPLATES_TOSCANODETEMPLATE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0630-toscanodetype.sql
--------------
CREATE TABLE IF NOT EXISTS toscanodetype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, requirementsVersion VARCHAR(20) NULL, requirementsName VARCHAR(120) NULL, CONSTRAINT PK_TOSCANODETYPE PRIMARY KEY (name, version))
--------------
> upgrade 0640-toscanodetypes.sql
--------------
CREATE TABLE IF NOT EXISTS toscanodetypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCANODETYPES PRIMARY KEY (name, version))
--------------
> upgrade 0650-toscanodetypes_toscanodetype.sql
--------------
CREATE TABLE IF NOT EXISTS toscanodetypes_toscanodetype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCANODETYPES_TOSCANODETYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0660-toscaparameter.sql
--------------
CREATE TABLE IF NOT EXISTS toscaparameter (VALUE VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPARAMETER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0670-toscapolicies.sql
--------------
CREATE TABLE IF NOT EXISTS toscapolicies (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAPOLICIES PRIMARY KEY (name, version))
--------------
> upgrade 0680-toscapolicies_toscapolicy.sql
--------------
CREATE TABLE IF NOT EXISTS toscapolicies_toscapolicy (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPOLICIES_TOSCAPOLICY PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0690-toscapolicy.sql
--------------
CREATE TABLE IF NOT EXISTS toscapolicy (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, CONSTRAINT PK_TOSCAPOLICY PRIMARY KEY (name, version))
--------------
> upgrade 0700-toscapolicytype.sql
--------------
CREATE TABLE IF NOT EXISTS toscapolicytype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAPOLICYTYPE PRIMARY KEY (name, version))
--------------
> upgrade 0710-toscapolicytypes.sql
--------------
CREATE TABLE IF NOT EXISTS toscapolicytypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAPOLICYTYPES PRIMARY KEY (name, version))
--------------
> upgrade 0720-toscapolicytypes_toscapolicytype.sql
--------------
CREATE TABLE IF NOT EXISTS toscapolicytypes_toscapolicytype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPOLICYTYPES_TOSCAPOLICYTYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0730-toscaproperty.sql
--------------
CREATE TABLE IF NOT EXISTS toscaproperty (DEFAULTVALUE VARCHAR(255) NULL, `DESCRIPTION` VARCHAR(255) NULL, ENTRYSCHEMA LONGBLOB DEFAULT NULL NULL, REQUIRED BIT DEFAULT 0 NULL, STATUS INT DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAPROPERTY PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0740-toscarelationshiptype.sql
--------------
CREATE TABLE IF NOT EXISTS toscarelationshiptype (`DESCRIPTION` VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCARELATIONSHIPTYPE PRIMARY KEY (name, version))
--------------
> upgrade 0750-toscarelationshiptypes.sql
--------------
CREATE TABLE IF NOT EXISTS toscarelationshiptypes (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCARELATIONSHIPTYPES PRIMARY KEY (name, version))
--------------
> upgrade 0760-toscarelationshiptypes_toscarelationshiptype.sql
--------------
CREATE TABLE IF NOT EXISTS toscarelationshiptypes_toscarelationshiptype (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCARELATIONSHIPTYPES_TOSCARELATIONSHIPTYPE PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0770-toscarequirement.sql
--------------
CREATE TABLE IF NOT EXISTS toscarequirement (CAPABILITY VARCHAR(255) NULL, `DESCRIPTION` VARCHAR(255) NULL, NODE VARCHAR(255) NULL, RELATIONSHIP VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, type_name VARCHAR(255) NULL, type_version VARCHAR(255) NULL, CONSTRAINT PK_TOSCAREQUIREMENT PRIMARY KEY (name, version))
--------------
> upgrade 0780-toscarequirements.sql
--------------
CREATE TABLE IF NOT EXISTS toscarequirements (name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_TOSCAREQUIREMENTS PRIMARY KEY (name, version))
--------------
> upgrade 0790-toscarequirements_toscarequirement.sql
--------------
CREATE TABLE IF NOT EXISTS toscarequirements_toscarequirement (conceptContainerMapName VARCHAR(120) NOT NULL, concpetContainerMapVersion VARCHAR(20) NOT NULL, conceptContainerName VARCHAR(120) NOT NULL, conceptContainerVersion VARCHAR(20) NOT NULL, name VARCHAR(120) NULL, version VARCHAR(20) NULL, CONSTRAINT PK_TOSCAREQUIREMENTS_TOSCAREQUIREMENT PRIMARY KEY (conceptContainerMapName, concpetContainerMapVersion, conceptContainerName, conceptContainerVersion))
--------------
> upgrade 0800-toscaservicetemplate.sql
--------------
CREATE TABLE IF NOT EXISTS toscaservicetemplate (`DESCRIPTION` VARCHAR(255) NULL, TOSCADEFINITIONSVERSION VARCHAR(255) NULL, derived_from_name VARCHAR(255) NULL, derived_from_version VARCHAR(255) NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, capabilityTypesVersion VARCHAR(20) NULL, capabilityTypesName VARCHAR(120) NULL, dataTypesName VARCHAR(120) NULL, dataTypesVersion VARCHAR(20) NULL, nodeTypesVersion VARCHAR(20) NULL, nodeTypesName VARCHAR(120) NULL, policyTypesName VARCHAR(120) NULL, policyTypesVersion VARCHAR(20) NULL, relationshipTypesVersion VARCHAR(20) NULL, relationshipTypesName VARCHAR(120) NULL, topologyTemplateLocalName VARCHAR(120) NULL, topologyTemplateParentKeyName VARCHAR(120) NULL, topologyTemplateParentKeyVersion VARCHAR(15) NULL, topologyTemplateParentLocalName VARCHAR(120) NULL, CONSTRAINT PK_TOSCASERVICETEMPLATE PRIMARY KEY (name, version))
--------------
> upgrade 0810-toscatopologytemplate.sql
--------------
CREATE TABLE IF NOT EXISTS toscatopologytemplate (`description` VARCHAR(255) NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, nodeTemplatessVersion VARCHAR(20) NULL, nodeTemplatesName VARCHAR(120) NULL, policyVersion VARCHAR(20) NULL, policyName VARCHAR(120) NULL, CONSTRAINT PK_TOSCATOPOLOGYTEMPLATE PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0820-toscatrigger.sql
--------------
CREATE TABLE IF NOT EXISTS toscatrigger (ACTION VARCHAR(255) NULL, toscaCondition LONGBLOB DEFAULT NULL NULL, toscaConstraint LONGBLOB DEFAULT NULL NULL, `DESCRIPTION` VARCHAR(255) NULL, EVALUATIONS INT DEFAULT NULL NULL, EVENTTYPE VARCHAR(255) NULL, METHOD VARCHAR(255) NULL, `PERIOD` LONGBLOB DEFAULT NULL NULL, SCHEDULE LONGBLOB DEFAULT NULL NULL, TARGETFILTER LONGBLOB DEFAULT NULL NULL, parentLocalName VARCHAR(120) NOT NULL, localName VARCHAR(120) NOT NULL, parentKeyVersion VARCHAR(15) NOT NULL, parentKeyName VARCHAR(120) NOT NULL, CONSTRAINT PK_TOSCATRIGGER PRIMARY KEY (parentLocalName, localName, parentKeyVersion, parentKeyName))
--------------
> upgrade 0830-FK_ToscaNodeTemplate_capabilitiesName.sql
--------------
CREATE INDEX FK_ToscaNodeTemplate_capabilitiesName ON toscanodetemplate(capabilitiesName, capabilitiesVersion)
--------------
> upgrade 0840-FK_ToscaNodeTemplate_requirementsName.sql
--------------
CREATE INDEX FK_ToscaNodeTemplate_requirementsName ON toscanodetemplate(requirementsName, requirementsVersion)
--------------
> upgrade 0850-FK_ToscaNodeType_requirementsName.sql
--------------
CREATE INDEX FK_ToscaNodeType_requirementsName ON toscanodetype(requirementsName, requirementsVersion)
--------------
> upgrade 0860-FK_ToscaServiceTemplate_capabilityTypesName.sql
--------------
CREATE INDEX FK_ToscaServiceTemplate_capabilityTypesName ON toscaservicetemplate(capabilityTypesName, capabilityTypesVersion)
--------------
> upgrade 0870-FK_ToscaServiceTemplate_dataTypesName.sql
--------------
CREATE INDEX FK_ToscaServiceTemplate_dataTypesName ON toscaservicetemplate(dataTypesName, dataTypesVersion)
--------------
> upgrade 0880-FK_ToscaServiceTemplate_nodeTypesName.sql
--------------
CREATE INDEX FK_ToscaServiceTemplate_nodeTypesName ON toscaservicetemplate(nodeTypesName, nodeTypesVersion)
--------------
> upgrade 0890-FK_ToscaServiceTemplate_policyTypesName.sql
--------------
CREATE INDEX FK_ToscaServiceTemplate_policyTypesName ON toscaservicetemplate(policyTypesName, policyTypesVersion)
--------------
> upgrade 0900-FK_ToscaServiceTemplate_relationshipTypesName.sql
--------------
CREATE INDEX FK_ToscaServiceTemplate_relationshipTypesName ON toscaservicetemplate(relationshipTypesName, relationshipTypesVersion)
--------------
> upgrade 0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
--------------
CREATE INDEX FK_ToscaTopologyTemplate_nodeTemplatesName ON toscatopologytemplate(nodeTemplatesName, nodeTemplatessVersion)
--------------
> upgrade 0920-FK_ToscaTopologyTemplate_policyName.sql
--------------
CREATE INDEX FK_ToscaTopologyTemplate_policyName ON toscatopologytemplate(policyName, policyVersion)
--------------
> upgrade 0940-PdpPolicyStatus_PdpGroup.sql
--------------
CREATE INDEX PdpPolicyStatus_PdpGroup ON pdppolicystatus(PDPGROUP)
--------------
> upgrade 0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql
--------------
CREATE INDEX TscaServiceTemplatetopologyTemplateParentLocalName ON toscaservicetemplate(topologyTemplateParentLocalName, topologyTemplateLocalName, topologyTemplateParentKeyVersion, topologyTemplateParentKeyName)
--------------
> upgrade 0960-FK_ToscaNodeTemplate_capabilitiesName.sql
--------------
ALTER TABLE toscanodetemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES toscacapabilityassignments (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 0970-FK_ToscaNodeTemplate_requirementsName.sql
--------------
ALTER TABLE toscanodetemplate ADD CONSTRAINT FK_ToscaNodeTemplate_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES toscarequirements (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 0980-FK_ToscaNodeType_requirementsName.sql
--------------
ALTER TABLE toscanodetype ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES toscarequirements (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 0990-FK_ToscaServiceTemplate_capabilityTypesName.sql
--------------
ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_capabilityTypesName FOREIGN KEY (capabilityTypesName, capabilityTypesVersion) REFERENCES toscacapabilitytypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 1000-FK_ToscaServiceTemplate_dataTypesName.sql
--------------
ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES toscadatatypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 1010-FK_ToscaServiceTemplate_nodeTypesName.sql
--------------
ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_nodeTypesName FOREIGN KEY (nodeTypesName, nodeTypesVersion) REFERENCES toscanodetypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 1020-FK_ToscaServiceTemplate_policyTypesName.sql
--------------
ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_policyTypesName FOREIGN KEY (policyTypesName, policyTypesVersion) REFERENCES toscapolicytypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 1030-FK_ToscaServiceTemplate_relationshipTypesName.sql
--------------
ALTER TABLE toscaservicetemplate ADD CONSTRAINT FK_ToscaServiceTemplate_relationshipTypesName FOREIGN KEY (relationshipTypesName, relationshipTypesVersion) REFERENCES toscarelationshiptypes (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql
--------------
ALTER TABLE toscatopologytemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_nodeTemplatesName FOREIGN KEY (nodeTemplatesName, nodeTemplatessVersion) REFERENCES toscanodetemplates (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 1050-FK_ToscaTopologyTemplate_policyName.sql
--------------
ALTER TABLE toscatopologytemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES toscapolicies (name, version) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql
--------------
ALTER TABLE toscaservicetemplate ADD CONSTRAINT TscaServiceTemplatetopologyTemplateParentLocalName FOREIGN KEY (topologyTemplateParentLocalName, topologyTemplateLocalName, topologyTemplateParentKeyVersion, topologyTemplateParentKeyName) REFERENCES toscatopologytemplate (parentLocalName, localName, parentKeyVersion, parentKeyName) ON UPDATE RESTRICT ON DELETE RESTRICT
--------------
> upgrade 0100-pdp.sql
--------------
ALTER TABLE pdp ADD COLUMN LASTUPDATE datetime DEFAULT NULL NULL AFTER HEALTHY
--------------
> upgrade 0110-idx_tsidx1.sql
--------------
CREATE INDEX IDX_TSIDX1 ON pdpstatistics(timeStamp, name, version)
--------------
> upgrade 0120-pk_pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics DROP PRIMARY KEY
--------------
> upgrade 0130-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics ADD COLUMN POLICYUNDEPLOYCOUNT BIGINT DEFAULT NULL NULL AFTER POLICYEXECUTEDSUCCESSCOUNT, ADD COLUMN POLICYUNDEPLOYFAILCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN POLICYUNDEPLOYSUCCESSCOUNT BIGINT DEFAULT NULL NULL, ADD COLUMN ID BIGINT NOT NULL
--------------
> upgrade 0140-pk_pdpstatistics.sql
--------------
UPDATE pdpstatistics as p JOIN (SELECT name, version, timeStamp, ROW_NUMBER() OVER (ORDER BY timeStamp ASC) AS row_num FROM pdpstatistics GROUP BY name, version, timeStamp) AS t ON (p.name=t.name AND p.version=t.version AND p.timeStamp = t.timeStamp) SET p.id=t.row_num
--------------
--------------
ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version)
--------------
> upgrade 0150-pdpstatistics.sql
--------------
ALTER TABLE pdpstatistics MODIFY COLUMN timeStamp datetime NULL
--------------
> upgrade 0160-jpapdpstatistics_enginestats.sql
--------------
ALTER TABLE jpapdpstatistics_enginestats ADD COLUMN ID BIGINT DEFAULT NULL NULL AFTER UPTIME
--------------
> upgrade 0170-jpapdpstatistics_enginestats.sql
--------------
UPDATE jpapdpstatistics_enginestats a
JOIN pdpstatistics b
ON a.name = b.name AND a.version = b.version AND a.timeStamp = b.timeStamp
SET a.id = b.id
--------------
> upgrade 0180-jpapdpstatistics_enginestats.sql
--------------
ALTER TABLE jpapdpstatistics_enginestats DROP COLUMN timeStamp
--------------
> upgrade 0190-jpapolicyaudit.sql
--------------
CREATE TABLE IF NOT EXISTS jpapolicyaudit (ACTION INT DEFAULT NULL NULL, PDPGROUP VARCHAR(255) NULL, PDPTYPE VARCHAR(255) NULL, TIMESTAMP datetime DEFAULT NULL NULL, USER VARCHAR(255) NULL, ID BIGINT NOT NULL, name VARCHAR(120) NOT NULL, version VARCHAR(20) NOT NULL, CONSTRAINT PK_JPAPOLICYAUDIT PRIMARY KEY (ID, name, version))
--------------
> upgrade 0200-JpaPolicyAuditIndex_timestamp.sql
--------------
CREATE INDEX JpaPolicyAuditIndex_timestamp ON jpapolicyaudit(TIMESTAMP)
--------------
> upgrade 0210-sequence.sql
--------------
CREATE TABLE IF NOT EXISTS sequence (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38) DEFAULT NULL NULL, CONSTRAINT PK_SEQUENCE PRIMARY KEY (SEQ_NAME))
--------------
> upgrade 0220-sequence.sql
--------------
INSERT INTO sequence(SEQ_NAME, SEQ_COUNT) VALUES('SEQ_GEN', (SELECT IFNULL(max(id),0) FROM pdpstatistics))
--------------
policyadmin: OK: upgrade (0900)
+ rc=0
+ /opt/app/policy/bin/db-migrator -s policyadmin -o report
name version
policyadmin 0900
ID script operation from_version to_version tag success atTime
1 0100-jpapdpgroup_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:12
2 0110-jpapdpstatistics_enginestats.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:12
3 0120-jpapdpsubgroup_policies.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:12
4 0130-jpapdpsubgroup_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:13
5 0140-jpapdpsubgroup_supportedpolicytypes.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:13
6 0150-jpatoscacapabilityassignment_attributes.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:13
7 0160-jpatoscacapabilityassignment_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:13
8 0170-jpatoscacapabilityassignment_occurrences.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:13
9 0180-jpatoscacapabilityassignment_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:13
10 0190-jpatoscacapabilitytype_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:14
11 0200-jpatoscacapabilitytype_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:14
12 0210-jpatoscadatatype_constraints.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:14
13 0220-jpatoscadatatype_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:14
14 0230-jpatoscadatatype_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:14
15 0240-jpatoscanodetemplate_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:15
16 0250-jpatoscanodetemplate_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:15
17 0260-jpatoscanodetype_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:15
18 0270-jpatoscanodetype_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:15
19 0280-jpatoscapolicy_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:15
20 0290-jpatoscapolicy_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:15
21 0300-jpatoscapolicy_targets.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:15
22 0310-jpatoscapolicytype_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:16
23 0320-jpatoscapolicytype_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:16
24 0330-jpatoscapolicytype_targets.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:16
25 0340-jpatoscapolicytype_triggers.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:16
26 0350-jpatoscaproperty_constraints.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:16
27 0360-jpatoscaproperty_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:17
28 0370-jpatoscarelationshiptype_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:17
29 0380-jpatoscarelationshiptype_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:17
30 0390-jpatoscarequirement_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:17
31 0400-jpatoscarequirement_occurrences.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:18
32 0410-jpatoscarequirement_properties.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:18
33 0420-jpatoscaservicetemplate_metadata.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:18
34 0430-jpatoscatopologytemplate_inputs.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:18
35 0440-pdpgroup_pdpsubgroup.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:18
36 0450-pdpgroup.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:18
37 0460-pdppolicystatus.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:19
38 0470-pdp.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:19
39 0480-pdpstatistics.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:19
40 0490-pdpsubgroup_pdp.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:19
41 0500-pdpsubgroup.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:19
42 0510-toscacapabilityassignment.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:19
43 0520-toscacapabilityassignments.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:19
44 0530-toscacapabilityassignments_toscacapabilityassignment.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
45 0540-toscacapabilitytype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
46 0550-toscacapabilitytypes.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
47 0560-toscacapabilitytypes_toscacapabilitytype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
48 0570-toscadatatype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
49 0580-toscadatatypes.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
50 0590-toscadatatypes_toscadatatype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
51 0600-toscanodetemplate.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
52 0610-toscanodetemplates.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:20
53 0620-toscanodetemplates_toscanodetemplate.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
54 0630-toscanodetype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
55 0640-toscanodetypes.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
56 0650-toscanodetypes_toscanodetype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
57 0660-toscaparameter.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
58 0670-toscapolicies.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
59 0680-toscapolicies_toscapolicy.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
60 0690-toscapolicy.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
61 0700-toscapolicytype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:21
62 0710-toscapolicytypes.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
63 0720-toscapolicytypes_toscapolicytype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
64 0730-toscaproperty.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
65 0740-toscarelationshiptype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
66 0750-toscarelationshiptypes.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
67 0760-toscarelationshiptypes_toscarelationshiptype.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
68 0770-toscarequirement.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
69 0780-toscarequirements.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:22
70 0790-toscarequirements_toscarequirement.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
71 0800-toscaservicetemplate.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
72 0810-toscatopologytemplate.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
73 0820-toscatrigger.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
74 0830-FK_ToscaNodeTemplate_capabilitiesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
75 0840-FK_ToscaNodeTemplate_requirementsName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
76 0850-FK_ToscaNodeType_requirementsName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
77 0860-FK_ToscaServiceTemplate_capabilityTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:23
78 0870-FK_ToscaServiceTemplate_dataTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
79 0880-FK_ToscaServiceTemplate_nodeTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
80 0890-FK_ToscaServiceTemplate_policyTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
81 0900-FK_ToscaServiceTemplate_relationshipTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
82 0910-FK_ToscaTopologyTemplate_nodeTemplatesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
83 0920-FK_ToscaTopologyTemplate_policyName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
84 0940-PdpPolicyStatus_PdpGroup.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
85 0950-TscaServiceTemplatetopologyTemplateParentLocalName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:24
86 0960-FK_ToscaNodeTemplate_capabilitiesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:25
87 0970-FK_ToscaNodeTemplate_requirementsName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:25
88 0980-FK_ToscaNodeType_requirementsName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:25
89 0990-FK_ToscaServiceTemplate_capabilityTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:25
90 1000-FK_ToscaServiceTemplate_dataTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:25
91 1010-FK_ToscaServiceTemplate_nodeTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:25
92 1020-FK_ToscaServiceTemplate_policyTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:25
93 1030-FK_ToscaServiceTemplate_relationshipTypesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:26
94 1040-FK_ToscaTopologyTemplate_nodeTemplatesName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:26
95 1050-FK_ToscaTopologyTemplate_policyName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:26
96 1060-TscaServiceTemplatetopologyTemplateParentLocalName.sql upgrade 0 0800 2608211247120800u 1 2021-08-26 12:47:26
97 0100-pdp.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:26
98 0110-idx_tsidx1.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:26
99 0120-pk_pdpstatistics.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:26
100 0130-pdpstatistics.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
101 0140-pk_pdpstatistics.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
102 0150-pdpstatistics.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
103 0160-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
104 0170-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
105 0180-jpapdpstatistics_enginestats.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
106 0190-jpapolicyaudit.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
107 0200-JpaPolicyAuditIndex_timestamp.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
108 0210-sequence.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
109 0220-sequence.sql upgrade 0800 0900 2608211247120900u 1 2021-08-26 12:47:27
policyadmin: OK @ 0900
+ exit 0
root@esy-master-policy-002-nfs:~/oom/kubernetes#
Other policy pods are not starting:
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl get pods | grep policy
dev-policy-apex-pdp-0 0/1 Init:CrashLoopBackOff 6 11m
dev-policy-api-78976fbd5d-pbk4h 0/1 Init:CrashLoopBackOff 5 11m
dev-policy-clamp-be-5c6cb758d8-hgf8w 0/1 Init:CrashLoopBackOff 5 11m
dev-policy-clamp-fe-569494fb5d-5qfkr 0/1 Init:0/3 1 11m
dev-policy-clamp-galera-config-5g2kb 0/1 Completed 0 11m
dev-policy-distribution-7dfdfbd64c-lzj46 0/1 Init:CrashLoopBackOff 6 11m
dev-policy-drools-pdp-0 0/1 Init:CrashLoopBackOff 5 11m
dev-policy-galera-config-xg8nl 0/1 Completed 0 11m
dev-policy-mariadb-0 2/2 Running 0 11m
dev-policy-pap-7899b7f9fb-x6pf8 0/1 Init:CrashLoopBackOff 5 11m
dev-policy-xacml-pdp-68f589ccc4-xmv6h 0/1 Init:CrashLoopBackOff 5 11m
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl logs dev-policy-apex-pdp-0
Error from server (BadRequest): container "policy-apex-pdp" in pod "dev-policy-apex-pdp-0" is waiting to start: PodInitializing
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl logs dev-policy-api-78976fbd5d-pbk4h
Error from server (BadRequest): container "policy-api" in pod "dev-policy-api-78976fbd5d-pbk4h" is waiting to start: PodInitializing
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl describe pod dev-policy-api-78976fbd5d-pbk4h
Name: dev-policy-api-78976fbd5d-pbk4h
Namespace: onap
Priority: 0
Node: esy-master-policy-002-k8s-02/172.16.1.104
Start Time: Thu, 26 Aug 2021 12:45:28 +0000
Labels: app=policy-api
pod-template-hash=78976fbd5d
release=dev
Annotations: cni.projectcalico.org/podIP: 10.42.2.102/32
cni.projectcalico.org/podIPs: 10.42.2.102/32
Status: Pending
IP: 10.42.2.102
IPs:
IP: 10.42.2.102
Controlled By: ReplicaSet/dev-policy-api-78976fbd5d
Init Containers:
policy-api-readiness:
Container ID: docker://39636ea6356d2efffb5a30035650102baeaa23a2cff820e9e089b20f1b158cd6
Image: nexus3.onap.org:10001/onap/oom/readiness:3.0.1
Image ID: docker-pullable://nexus3.onap.org:10001/onap/oom/readiness@sha256:317c8a361ae73750f4d4a1b682c42b73de39083f73228dede31fd68b16c089db
Port: <none>
Host Port: <none>
Command:
/app/ready.py
Args:
--job-name
dev-policy-galera-config
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 26 Aug 2021 12:45:35 +0000
Finished: Thu, 26 Aug 2021 12:47:31 +0000
Ready: True
Restart Count: 0
Environment:
NAMESPACE: onap (v1:metadata.namespace)
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-api-read-token-jxvtg (ro)
policy-api-update-config:
Container ID: docker://5788bd3c5edddf32274b0cba56910788f6682ac057c84619a5f1b40d43805bcf
Image: docker.io/dibi/envsubst:1
Image ID: docker-pullable://dibi/envsubst@sha256:6f1938ec2114e98406b9dcc638929fcbe68add3d94eb8629e0cbed03b72f09f8
Port: <none>
Host Port: <none>
Command:
sh
Args:
-c
cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 26 Aug 2021 12:47:34 +0000
Finished: Thu, 26 Aug 2021 12:47:34 +0000
Ready: True
Restart Count: 0
Environment:
SQL_USER: <set to the key 'login' in secret 'dev-policy-db-secret'> Optional: false
SQL_PASSWORD: <set to the key 'password' in secret 'dev-policy-db-secret'> Optional: false
RESTSERVER_USER: <set to the key 'login' in secret 'dev-policy-api-restserver-creds'> Optional: false
RESTSERVER_PASSWORD: <set to the key 'password' in secret 'dev-policy-api-restserver-creds'> Optional: false
Mounts:
/config from apiconfig-processed (rw)
/config-input from apiconfig (rw)
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-api-read-token-jxvtg (ro)
policy-api-cert-initializer-readiness:
Container ID: docker://a608745a981839876de3e3a1afc6917b5c958c6584a854f214f20356f1ee3346
Image: nexus3.onap.org:10001/onap/oom/readiness:3.0.1
Image ID: docker-pullable://nexus3.onap.org:10001/onap/oom/readiness@sha256:317c8a361ae73750f4d4a1b682c42b73de39083f73228dede31fd68b16c089db
Port: <none>
Host Port: <none>
Command:
/app/ready.py
Args:
--container-name
aaf-locate
--container-name
aaf-cm
--container-name
aaf-service
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: OOMKilled
Exit Code: 137
Started: Thu, 26 Aug 2021 13:09:26 +0000
Finished: Thu, 26 Aug 2021 13:10:09 +0000
Ready: False
Restart Count: 8
Limits:
cpu: 100m
memory: 100Mi
Requests:
cpu: 3m
memory: 20Mi
Environment:
NAMESPACE: onap (v1:metadata.namespace)
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-api-read-token-jxvtg (ro)
policy-api-aaf-config:
Container ID:
Image: nexus3.onap.org:10001/onap/aaf/aaf_agent:2.1.20
Image ID:
Port: <none>
Host Port: <none>
Command:
sh
-c
/opt/app/aaf_config/bin/agent.sh
. /opt/app/aaf_config/bin/retrieval_check.sh
/opt/app/aaf_config/bin/aaf-add-config.sh
State: Waiting
Reason: PodInitializing
Ready: False
Restart Count: 0
Environment:
APP_FQI: policy@policy.onap.org
aaf_locate_url: https://aaf-locate.onap:8095
aaf_locator_container: oom
aaf_locator_container_ns: onap
aaf_locator_fqdn: policy
aaf_locator_app_ns: org.osaaf.aaf
DEPLOY_FQI: <set to the key 'login' in secret 'dev-policy-api-cert-initializer-deployer-creds'> Optional: false
DEPLOY_PASSWORD: <set to the key 'password' in secret 'dev-policy-api-cert-initializer-deployer-creds'> Optional: false
cadi_longitude: 0.0
cadi_latitude: 0.0
aaf_locator_public_fqdn: policy.onap.org
Mounts:
/opt/app/aaf_config/bin/aaf-add-config.sh from aaf-add-config (rw,path="aaf-add-config.sh")
/opt/app/aaf_config/bin/retrieval_check.sh from aaf-add-config (rw,path="retrieval_check.sh")
/opt/app/aaf_config/cert/truststoreONAP.p12.b64 from aaf-agent-certs (rw,path="truststoreONAP.p12.b64")
/opt/app/aaf_config/cert/truststoreONAPall.jks.b64 from aaf-agent-certs (rw,path="truststoreONAPall.jks.b64")
/opt/app/osaaf from dev-policy-api-aaf-config (rw)
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-api-read-token-jxvtg (ro)
Containers:
policy-api:
Container ID:
Image: nexus3.onap.org:10001/onap/policy-api:2.5-SNAPSHOT-latest
Image ID:
Port: 6969/TCP
Host Port: 0/TCP
Command:
sh
-c
Args:
source /opt/app/osaaf/local/.ci;/opt/app/policy/api/bin/policy-api.sh /opt/app/policy/api/etc/mounted/config.json
State: Waiting
Reason: PodInitializing
Ready: False
Restart Count: 0
Liveness: tcp-socket :6969 delay=20s timeout=1s period=10s #success=1 #failure=3
Readiness: tcp-socket :6969 delay=20s timeout=1s period=10s #success=1 #failure=3
Environment: <none>
Mounts:
/etc/localtime from localtime (ro)
/opt/app/osaaf from dev-policy-api-aaf-config (rw)
/opt/app/policy/api/etc/mounted from apiconfig-processed (rw)
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-api-read-token-jxvtg (ro)
Conditions:
Type Status
Initialized False
Ready False
ContainersReady False
PodScheduled True
Volumes:
dev-policy-api-aaf-config:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium: Memory
SizeLimit: <unset>
aaf-agent-certs:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: dev-cert-wrapper-certs
Optional: false
aaf-add-config:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: dev-policy-api-cert-initializer-add-config
Optional: false
localtime:
Type: HostPath (bare host directory volume)
Path: /etc/localtime
HostPathType:
apiconfig:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: dev-policy-api-configmap
Optional: false
apiconfig-processed:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium: Memory
SizeLimit: <unset>
dev-policy-api-read-token-jxvtg:
Type: Secret (a volume populated by a Secret)
SecretName: dev-policy-api-read-token-jxvtg
Optional: false
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 26m default-scheduler Successfully assigned onap/dev-policy-api-78976fbd5d-pbk4h to esy-master-policy-002-k8s-02
Normal Pulled 26m kubelet Container image "nexus3.onap.org:10001/onap/oom/readiness:3.0.1" already present on machine
Normal Created 26m kubelet Created container policy-api-readiness
Normal Started 26m kubelet Started container policy-api-readiness
Normal Pulled 24m kubelet Container image "docker.io/dibi/envsubst:1" already present on machine
Normal Created 24m kubelet Created container policy-api-update-config
Normal Started 24m kubelet Started container policy-api-update-config
Normal Created 21m (x4 over 24m) kubelet Created container policy-api-cert-initializer-readiness
Normal Started 21m (x4 over 24m) kubelet Started container policy-api-cert-initializer-readiness
Normal Pulled 19m (x5 over 24m) kubelet Container image "nexus3.onap.org:10001/onap/oom/readiness:3.0.1" already present on machine
Warning BackOff 65s (x77 over 22m) kubelet Back-off restarting failed container
root@esy-master-policy-002-nfs:~/oom/kubernetes# kubectl describe pod dev-policy-apex-pdp-0
Name: dev-policy-apex-pdp-0
Namespace: onap
Priority: 0
Node: esy-master-policy-002-k8s-02/172.16.1.104
Start Time: Thu, 26 Aug 2021 12:45:31 +0000
Labels: app=policy-apex-pdp
controller-revision-hash=dev-policy-apex-pdp-566cf5665
release=dev
statefulset.kubernetes.io/pod-name=dev-policy-apex-pdp-0
Annotations: cni.projectcalico.org/podIP: 10.42.2.109/32
cni.projectcalico.org/podIPs: 10.42.2.109/32
Status: Pending
IP: 10.42.2.109
IPs:
IP: 10.42.2.109
Controlled By: StatefulSet/dev-policy-apex-pdp
Init Containers:
policy-apex-pdp-update-config:
Container ID: docker://408ca808d6166e320989015311c8de82b6418828b1b05e1bced0c3a05cd7bdd5
Image: docker.io/dibi/envsubst:1
Image ID: docker-pullable://dibi/envsubst@sha256:6f1938ec2114e98406b9dcc638929fcbe68add3d94eb8629e0cbed03b72f09f8
Port: <none>
Host Port: <none>
Command:
sh
Args:
-c
cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done
State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 26 Aug 2021 12:45:41 +0000
Finished: Thu, 26 Aug 2021 12:45:41 +0000
Ready: True
Restart Count: 0
Environment:
TRUSTSTORE_PASSWORD: <set to the key 'password' in secret 'dev-policy-apex-pdp-truststore-pass'> Optional: false
KEYSTORE_PASSWORD: <set to the key 'password' in secret 'dev-policy-apex-pdp-keystore-pass'> Optional: false
RESTSERVER_USER: <set to the key 'login' in secret 'dev-policy-apex-pdp-restserver-creds'> Optional: false
RESTSERVER_PASSWORD: <set to the key 'password' in secret 'dev-policy-apex-pdp-restserver-creds'> Optional: false
Mounts:
/config from apexconfig (rw)
/config-input from apexconfig-input (rw)
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-apex-pdp-read-token-x829k (ro)
policy-apex-pdp-cert-initializer-readiness:
Container ID: docker://f8c75fa194e74bb6dc615d0df4cd88bb1b6ddbc488105048ec0e681d8857257e
Image: nexus3.onap.org:10001/onap/oom/readiness:3.0.1
Image ID: docker-pullable://nexus3.onap.org:10001/onap/oom/readiness@sha256:317c8a361ae73750f4d4a1b682c42b73de39083f73228dede31fd68b16c089db
Port: <none>
Host Port: <none>
Command:
/app/ready.py
Args:
--container-name
aaf-locate
--container-name
aaf-cm
--container-name
aaf-service
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: OOMKilled
Exit Code: 137
Started: Thu, 26 Aug 2021 13:19:09 +0000
Finished: Thu, 26 Aug 2021 13:19:50 +0000
Ready: False
Restart Count: 10
Limits:
cpu: 100m
memory: 100Mi
Requests:
cpu: 3m
memory: 20Mi
Environment:
NAMESPACE: onap (v1:metadata.namespace)
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-apex-pdp-read-token-x829k (ro)
policy-apex-pdp-aaf-config:
Container ID:
Image: nexus3.onap.org:10001/onap/aaf/aaf_agent:2.1.20
Image ID:
Port: <none>
Host Port: <none>
Command:
sh
-c
/opt/app/aaf_config/bin/agent.sh
. /opt/app/aaf_config/bin/retrieval_check.sh
/opt/app/aaf_config/bin/aaf-add-config.sh
State: Waiting
Reason: PodInitializing
Ready: False
Restart Count: 0
Environment:
APP_FQI: policy@policy.onap.org
aaf_locate_url: https://aaf-locate.onap:8095
aaf_locator_container: oom
aaf_locator_container_ns: onap
aaf_locator_fqdn: policy
aaf_locator_app_ns: org.osaaf.aaf
DEPLOY_FQI: <set to the key 'login' in secret 'dev-policy-apex-pdp-cert-initializer-deployer-creds'> Optional: false
DEPLOY_PASSWORD: <set to the key 'password' in secret 'dev-policy-apex-pdp-cert-initializer-deployer-creds'> Optional: false
cadi_longitude: 0.0
cadi_latitude: 0.0
aaf_locator_public_fqdn: policy.onap.org
Mounts:
/opt/app/aaf_config/bin/aaf-add-config.sh from aaf-add-config (rw,path="aaf-add-config.sh")
/opt/app/aaf_config/bin/retrieval_check.sh from aaf-add-config (rw,path="retrieval_check.sh")
/opt/app/aaf_config/cert/truststoreONAP.p12.b64 from aaf-agent-certs (rw,path="truststoreONAP.p12.b64")
/opt/app/aaf_config/cert/truststoreONAPall.jks.b64 from aaf-agent-certs (rw,path="truststoreONAPall.jks.b64")
/opt/app/osaaf from dev-policy-apex-pdp-aaf-config (rw)
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-apex-pdp-read-token-x829k (ro)
Containers:
policy-apex-pdp:
Container ID:
Image: nexus3.onap.org:10001/onap/policy-apex-pdp:2.6-SNAPSHOT-latest
Image ID:
Port: 6969/TCP
Host Port: 0/TCP
Command:
sh
-c
Args:
if [ -f /opt/app/osaaf/local/.ci ]; then . /opt/app/osaaf/local/.ci; fi;/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /home/apexuser/config/OnapPfConfig.json
State: Waiting
Reason: PodInitializing
Ready: False
Restart Count: 0
Liveness: tcp-socket :6969 delay=20s timeout=1s period=10s #success=1 #failure=3
Readiness: tcp-socket :6969 delay=20s timeout=1s period=10s #success=1 #failure=3
Environment:
REPLICAS: 1
Mounts:
/etc/localtime from localtime (ro)
/home/apexuser/config from apexconfig (rw)
/opt/app/osaaf from dev-policy-apex-pdp-aaf-config (rw)
/var/log/onap from policy-logs (rw)
/var/run/secrets/kubernetes.io/serviceaccount from dev-policy-apex-pdp-read-token-x829k (ro)
Conditions:
Type Status
Initialized False
Ready False
ContainersReady False
PodScheduled True
Volumes:
dev-policy-apex-pdp-aaf-config:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium: Memory
SizeLimit: <unset>
aaf-agent-certs:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: dev-cert-wrapper-certs
Optional: false
aaf-add-config:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: dev-policy-apex-pdp-cert-initializer-add-config
Optional: false
localtime:
Type: HostPath (bare host directory volume)
Path: /etc/localtime
HostPathType:
policy-logs:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
apexconfig-input:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: dev-policy-apex-pdp-configmap
Optional: false
apexconfig:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium: Memory
SizeLimit: <unset>
dev-policy-apex-pdp-read-token-x829k:
Type: Secret (a volume populated by a Secret)
SecretName: dev-policy-apex-pdp-read-token-x829k
Optional: false
QoS Class: Burstable
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 35m default-scheduler Successfully assigned onap/dev-policy-apex-pdp-0 to esy-master-policy-002-k8s-02
Warning FailedMount 35m (x2 over 35m) kubelet MountVolume.SetUp failed for volume "apexconfig-input" : failed to sync configmap cache: timed out waiting for the condition
Warning FailedMount 35m (x3 over 35m) kubelet MountVolume.SetUp failed for volume "aaf-add-config" : failed to sync configmap cache: timed out waiting for the condition
Warning FailedMount 35m (x3 over 35m) kubelet MountVolume.SetUp failed for volume "dev-policy-apex-pdp-read-token-x829k" : failed to sync secret cache: timed out waiting for the condition
Normal Pulled 35m kubelet Container image "docker.io/dibi/envsubst:1" already present on machine
Normal Created 35m kubelet Created container policy-apex-pdp-update-config
Normal Started 35m kubelet Started container policy-apex-pdp-update-config
Normal Started 33m (x3 over 35m) kubelet Started container policy-apex-pdp-cert-initializer-readiness
Normal Pulled 32m (x4 over 35m) kubelet Container image "nexus3.onap.org:10001/onap/oom/readiness:3.0.1" already present on machine
Normal Created 32m (x4 over 35m) kubelet Created container policy-apex-pdp-cert-initializer-readiness
Warning BackOff 37s (x123 over 33m) kubelet Back-off restarting failed container
Exit Code
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: OOMKilled
Exit Code: 137
kubectl describe pods dev-policy-api-78976fbd5d-4xfx2 | grep -i exit
Exit Code: 0
Exit Code: 0
Exit Code: 137
kubectl describe pods dev-policy-pap-7899b7f9fb-dzwgh | grep -i exit
Exit Code: 0
Exit Code: 0
Exit Code: 137
kubectl describe pods dev-policy-apex-pdp-0 | grep -i exit
Exit Code: 0
Exit Code: 137
The Exit code 137 is important because it means that the system terminated the container as it tried to use more memory than its limit. In order to monitor this, you always have to look at the use of memory compared to the limit.
State: Running
Started: Thu, 26 Aug 2021 15:10:16 +0000
Last State: Terminated
Reason: OOMKilled
Exit Code: 137
Started: Thu, 26 Aug 2021 15:08:03 +0000
Finished: Thu, 26 Aug 2021 15:08:50 +0000
Ready: False
Restart Count: 5
Limits:
cpu: 100m
memory: 100Mi
Requests:
cpu: 3m
memory: 20Mi