Commit 80cff40
committed
Proper Detection of Previously Processed pgcluster
The pgcluster controller has been updated to properly detect whether or
not a specific pgcluster custom resource was previously processed via
the controller's 'onAdd' function. Specifically, the 'onAdd' function
will now no longer place a pgcluster in a 'processed' status and
attempt to call 'AddClusterBase' if it determines that the a previous
call to 'AddClusterBase' completed successfully. This is indicated by
either a value of 'completed' in the /spec/status' field of the
pgcluster (which indicates that a previous call to 'AddClusterBase'
successfully created the resources needed to bootstrap the PG cluster),
or a value of 'pgcluster Initialized' in the '/status/state' field
(which indicates that the cluster has been fully initialized).
In addition, the check for an existing Kubernetes Deployment matching
the name of the pgcluster, as well as the check to determine whether
or not a pgcluster custom resource is in a 'processed' status prior to
enqueuing it from the pgcluster controller's 'onAdd' function, have
been removed, since both are no longer valid methods for determining
whether or not to process a pgcluster. For instance, a Deployment
matching the pgcluster name (i.e. the original primary for the cluster)
might no longer exist if it was since scaled down and removed, while
the 'processed' status does not properly indicate whether or not the
various Kubernetes resources (e.g. Deployments) for the initial primary
utilized to bootstrap the cluster have been created, nor does it
properly indicate whether or not the PG cluster has been fully
initialized.
Issue: [ch9574]1 parent aaeaf4e commit 80cff40
File tree
2 files changed
+10
-30
lines changed- controller/pgcluster
- operator/cluster
2 files changed
+10
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 51 | | |
62 | 52 | | |
63 | 53 | | |
64 | 54 | | |
65 | 55 | | |
66 | | - | |
67 | 56 | | |
68 | 57 | | |
69 | 58 | | |
| |||
106 | 95 | | |
107 | 96 | | |
108 | 97 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 98 | | |
121 | 99 | | |
122 | | - | |
| 100 | + | |
123 | 101 | | |
124 | 102 | | |
125 | 103 | | |
126 | 104 | | |
127 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
128 | 115 | | |
129 | 116 | | |
130 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 66 | | |
74 | 67 | | |
75 | 68 | | |
| |||
0 commit comments