Skip to content

Commit

Permalink
Re-design LogStats field; Remove WalSegment
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha committed Dec 17, 2024
1 parent 19fa896 commit 38033d0
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 72 deletions.
48 changes: 18 additions & 30 deletions apis/storage/v1alpha1/snapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,36 +206,31 @@ type Component struct {
// +optional
VolumeSnapshotterStats []VolumeSnapshotterStats `json:"volumeSnapshotterStats,omitempty"`

// WalSegments specifies a list of wall segment for individual component
WalSegments []WalSegment `json:"walSegments,omitempty"`

WalStats *WalStats `json:"walStats,omitempty"`
LogStats *LogStats `json:"logStats,omitempty"`
}

// WalPhase represents the backup phase of the individual Wal.
// +kubebuilder:validation:Enum=Succeeded;Failed
type WalPhase string
type LogStats struct {
// Start represents the start time of the first log, that exists in the repository
// TODO: Need to update this start time, once the log-retention gets implemented
Start *string `json:"start,omitempty"`
// End represents the last end time of the log push
// Start & End together holds the full time-range. Not individual log.
End *string `json:"end,omitempty"`
// Lsn for PostgreSQL only
// +optional
Lsn *string `json:"lsn,omitempty"`

const (
WalPhaseSucceeded WalPhase = "Succeeded"
WalPhaseFailed WalPhase = "Failed"
)
TotalFailedCount int64 `json:"totalFailedCount,omitempty"`
LastFailedStats []Log `json:"lastFailedStats,omitempty"`

type WalStats struct {
LastFailedWalList []Wal `json:"FailedWalStats,omitempty"`
LastSucceedWalList []Wal `json:"SuccessfulWalStats,omitempty"`
TotalSucceededCount int64 `json:"totalSucceededCount,omitempty"`
LastSucceededStats []Log `json:"lastSucceededStats,omitempty"`
}
type Wal struct {

type Log struct {
Start *string `json:"start,omitempty"`
End *string `json:"end,omitempty"`

Phase WalPhase
Error string `json:"error,omitempty"`
Output string `json:"output,omitempty"`
Duration string `json:"duration,omitempty"`

// Lsn for PostgreSQL only
Lsn string `json:"lsn,omitempty"`
Error string `json:"error,omitempty"`
}

// ComponentPhase represents the backup phase of the individual component.
Expand Down Expand Up @@ -312,13 +307,6 @@ type WalGStats struct {
StopTime *metav1.Time `json:"stopTime,omitempty"`
}

// WalSegment specifies the "WalG" driver specific information
type WalSegment struct {
Start *string `json:"start,omitempty"`
End *string `json:"end,omitempty"`
Lsn *string `json:"lsn,omitempty"`
}

const (
TypeSnapshotMetadataUploaded = "SnapshotMetadataUploaded"
ReasonFailedToUploadSnapshotMetadata = "FailedToUploadSnapshotMetadata"
Expand Down
104 changes: 73 additions & 31 deletions apis/storage/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 37 additions & 11 deletions crds/storage.kubestash.com_snapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,43 @@ spec:
type: string
integrity:
type: boolean
logStats:
properties:
end:
type: string
lastFailedStats:
items:
properties:
end:
type: string
error:
type: string
start:
type: string
type: object
type: array
lastSucceededStats:
items:
properties:
end:
type: string
error:
type: string
start:
type: string
type: object
type: array
lsn:
type: string
start:
type: string
totalFailedCount:
format: int64
type: integer
totalSucceededCount:
format: int64
type: integer
type: object
path:
type: string
phase:
Expand Down Expand Up @@ -158,17 +195,6 @@ spec:
format: date-time
type: string
type: object
walSegments:
items:
properties:
end:
type: string
lsn:
type: string
start:
type: string
type: object
type: array
type: object
type: object
x-kubernetes-map-type: granular
Expand Down

0 comments on commit 38033d0

Please sign in to comment.