You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Xu-Wentao (via GitHub)" <gi...@apache.org> on 2023/04/04 09:46:33 UTC

[GitHub] [shardingsphere-on-cloud] Xu-Wentao opened a new pull request, #293: WIP: feat(storage-node): add reconcile logic

Xu-Wentao opened a new pull request, #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293

   <!-- Please answer these questions before submitting a pull request -->
   
   ### Type of change:
   
   <!-- Please delete options that are not relevant. -->
   
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   - implement storage node `reconcile` logic
   - support `aws-aurora` database
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Test is required for the feat/fix PR, unless you have a good reason
   2. Doc is required for the feat PR
   3. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-on-cloud] Xu-Wentao commented on pull request #293: feat(storage-node): add reconcile logic

Posted by "Xu-Wentao (via GitHub)" <gi...@apache.org>.
Xu-Wentao commented on PR #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293#issuecomment-1506392132

   > Please change the remote branch to `feat-storagenode`
   
   done!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-on-cloud] mlycore commented on a diff in pull request #293: feat(storage-node): add reconcile logic

Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore commented on code in PR #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293#discussion_r1164911903


##########
shardingsphere-operator/api/v1alpha1/storage_node_types.go:
##########
@@ -17,7 +17,65 @@
 
 package v1alpha1
 
-import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+import (
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type StorageNodePhaseStatus string
+
+const (
+	StorageNodePhaseReady    StorageNodePhaseStatus = "Ready"
+	StorageNodePhaseNotReady StorageNodePhaseStatus = "NotReady"
+)
+
+type StorageNodeConditionType string
+
+// StorageNodeConditionType shows some states during the startup process of storage node
+const (
+	StorageNodeConditionTypeAvailable StorageNodeConditionType = "Available"

Review Comment:
   Please add explanation for these two conditions and update related design proposal.



##########
shardingsphere-operator/api/v1alpha1/storage_node_types.go:
##########
@@ -17,7 +17,65 @@
 
 package v1alpha1
 
-import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+import (
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type StorageNodePhaseStatus string
+
+const (
+	StorageNodePhaseReady    StorageNodePhaseStatus = "Ready"
+	StorageNodePhaseNotReady StorageNodePhaseStatus = "NotReady"
+)
+
+type StorageNodeConditionType string
+
+// StorageNodeConditionType shows some states during the startup process of storage node
+const (
+	StorageNodeConditionTypeAvailable StorageNodeConditionType = "Available"
+	StorageNodeConditionTypeDegraded  StorageNodeConditionType = "Degraded"
+)
+
+type StorageNodeConditions []*StorageNodeCondition
+
+// StorageNodeCondition contains details for the current condition of this StorageNode.
+type StorageNodeCondition struct {
+	Type           StorageNodeConditionType `json:"type"`
+	Status         corev1.ConditionStatus   `json:"status"`
+	LastUpdateTime metav1.Time              `json:"lastUpdateTime,omitempty"`
+	Reason         string                   `json:"reason"`
+	Message        string                   `json:"message"`
+}
+
+// ClusterStatus is the status of a database cluster, including the primary endpoint, reader endpoints, and other properties.
+// Properties are some additional information about the cluster, like 'arn, identifier, credentials, etc.'
+type ClusterStatus struct {
+	Status          string            `json:"status"`
+	PrimaryEndpoint Endpoint          `json:"primaryEndpoint"`
+	ReaderEndpoints []Endpoint        `json:"readerEndpoints"`
+	Properties      map[string]string `json:"properties"`
+}
+
+type CredentialType struct {
+	BasicCredential `json:"basic_credential"`
+}
+
+type InstanceStatus struct {
+	Status     string            `json:"status"`
+	Endpoint   Endpoint          `json:"primaryEndpoint"`
+	Properties map[string]string `json:"properties"`
+}
+
+type BasicCredential struct {
+	Username string `json:"user"`

Review Comment:
   For better maintainability, please tag the object member with same name.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-on-cloud] mlycore commented on a diff in pull request #293: feat(storage-node): add reconcile logic

Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore commented on code in PR #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293#discussion_r1165043668


##########
shardingsphere-operator/api/v1alpha1/storage_node_types.go:
##########
@@ -17,7 +17,65 @@
 
 package v1alpha1
 
-import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+import (
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type StorageNodePhaseStatus string
+
+const (
+	StorageNodePhaseReady    StorageNodePhaseStatus = "Ready"
+	StorageNodePhaseNotReady StorageNodePhaseStatus = "NotReady"
+)
+
+type StorageNodeConditionType string
+
+// StorageNodeConditionType shows some states during the startup process of storage node
+const (
+	StorageNodeConditionTypeAvailable StorageNodeConditionType = "Available"

Review Comment:
   > Just retain the "Available" condition for describe the whole storageNode is available or not, it's depends cluster is ready and all instances are ready. We may add more additional conditions for more info in the future.
   
   Yeah, this makes sense.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-on-cloud] Xu-Wentao commented on a diff in pull request #293: feat(storage-node): add reconcile logic

Posted by "Xu-Wentao (via GitHub)" <gi...@apache.org>.
Xu-Wentao commented on code in PR #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293#discussion_r1165036072


##########
shardingsphere-operator/api/v1alpha1/storage_node_types.go:
##########
@@ -17,7 +17,65 @@
 
 package v1alpha1
 
-import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+import (
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type StorageNodePhaseStatus string
+
+const (
+	StorageNodePhaseReady    StorageNodePhaseStatus = "Ready"
+	StorageNodePhaseNotReady StorageNodePhaseStatus = "NotReady"
+)
+
+type StorageNodeConditionType string
+
+// StorageNodeConditionType shows some states during the startup process of storage node
+const (
+	StorageNodeConditionTypeAvailable StorageNodeConditionType = "Available"

Review Comment:
   Just retain the "Available" condition for describe the whole storageNode is available or not, it's depends cluster is ready and all instances are ready.
   We may add more additional conditions for more info in the future.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-on-cloud] Xu-Wentao commented on pull request #293: WIP: feat(storage-node): add reconcile logic

Posted by "Xu-Wentao (via GitHub)" <gi...@apache.org>.
Xu-Wentao commented on PR #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293#issuecomment-1495865607

   this [issue](https://github.com/kubernetes-sigs/kubebuilder/issues/3303) resolve the problem about controller-runtime install crd failed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-on-cloud] mlycore commented on pull request #293: WIP: feat(storage-node): add reconcile logic

Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore commented on PR #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293#issuecomment-1500126990

   Please change the remote branch to `feat-storagenode`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-on-cloud] mlycore merged pull request #293: feat(storage-node): add reconcile logic

Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore merged PR #293:
URL: https://github.com/apache/shardingsphere-on-cloud/pull/293


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org