Consensys / quorum-kubernetes

Helm charts for Hyperledger Besu and GoQuorum
Apache License 2.0
120 stars 129 forks source link

The local persistent volume is re-used when we re-create quorum blockchain. #116

Closed scalalang2 closed 2 years ago

scalalang2 commented 2 years ago

Hi. I've tested dev helm charts over time. And I found that if I configure the blockchain more than once, the persistent volume of the second configured nodes seems to be reused.

I built go-quorum blockchain in quorum namespace 3 days ago. It seems fine. But, after 3 days. I deleted all resources in quorum namespace. And I configured it testnet namespace again.

In second time, the block height of node is not starting from 1, it is 65536.

> eth.getBlock(1)
{
  ...
  timestamp: 1646281365, // Thu Mar 03 2022 04:22:45 GMT+0000, but current timestamp is Mar 08 2022
  ...
}

I think the reason is that the storage class of PV is not valid when the provider is local.

# provider: local
apiVersion: v1
kind: PersistentVolume
metadata:
  name: {{ include "goquorum-node.fullname" . }}-storage
  namespace: {{ .Release.Namespace }}
  labels:
    type: local
spec:
  storageClassName: {{ include "goquorum-node.fullname" . }}-storage # it is not valid storage class right?
  capacity:
    storage: "{{ .Values.storage.sizeLimit }}"
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/tmp/{{ include "goquorum-node.fullname" . }}"
joshuafernandes commented 2 years ago

Hello @scalalang2 , that depends on what you're using locally - minikube, kind etc. We set things to retain so the pv remains. In your case, I believe the storage class hostPath is the same (last line) and so will always pull up old data - add some entropy there if you wish to make it unique