Skip to content

Commit

Permalink
Re-design WalStats field; Remove WalSegment (#142)
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
Signed-off-by: souravbiswassanto <[email protected]>
Signed-off-by: Anisur Rahman <[email protected]>
Co-authored-by: souravbiswassanto <[email protected]>
Co-authored-by: Anisur Rahman <[email protected]>
  • Loading branch information
3 people authored Dec 17, 2024
1 parent 3af40bb commit 8f481a8
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 48 deletions.
34 changes: 26 additions & 8 deletions apis/storage/v1alpha1/snapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,32 @@ type Component struct {
// VolumeSnapshotterStats specifies the "VolumeSnapshotter" driver specific information
// +optional
VolumeSnapshotterStats []VolumeSnapshotterStats `json:"volumeSnapshotterStats,omitempty"`
// WalSegments specifies a list of wall segment for individual component
WalSegments []WalSegment `json:"walSegments,omitempty"`

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

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"`

TotalFailedCount int64 `json:"totalFailedCount,omitempty"`
LastFailedStats []Log `json:"lastFailedStats,omitempty"`

TotalSucceededCount int64 `json:"totalSucceededCount,omitempty"`
LastSucceededStats []Log `json:"lastSucceededStats,omitempty"`
}

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

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

// WalSegment specifies the "WalG" driver specific information
type WalSegment struct {
Start *metav1.Time `json:"start,omitempty"`
End *metav1.Time `json:"end,omitempty"`
}

const (
TypeSnapshotMetadataUploaded = "SnapshotMetadataUploaded"
ReasonFailedToUploadSnapshotMetadata = "FailedToUploadSnapshotMetadata"
Expand Down
102 changes: 73 additions & 29 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:
format: date-time
type: string
start:
format: date-time
type: string
type: object
type: array
type: object
type: object
x-kubernetes-map-type: granular
Expand Down

0 comments on commit 8f481a8

Please sign in to comment.