diff --git a/replication.go b/replication.go index d6f7ee09d76..80282aad345 100644 --- a/replication.go +++ b/replication.go @@ -20,21 +20,21 @@ var ErrMaxQueueSizeTooSmall = errors.Error{ // Replication contains all info about a replication that should be returned to users. type Replication struct { - ID platform.ID `json:"id" db:"id"` - OrgID platform.ID `json:"orgID" db:"org_id"` - Name string `json:"name" db:"name"` - Description *string `json:"description,omitempty" db:"description"` - RemoteID platform.ID `json:"remoteID" db:"remote_id"` - LocalBucketID platform.ID `json:"localBucketID" db:"local_bucket_id"` - RemoteBucketID *platform.ID `json:"remoteBucketID" db:"remote_bucket_id"` - RemoteBucketName string `json:"RemoteBucketName" db:"remote_bucket_name"` - MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes" db:"max_queue_size_bytes"` - CurrentQueueSizeBytes int64 `json:"currentQueueSizeBytes" db:"current_queue_size_bytes"` - RemainingQueueSizeBytes int64 `json:"remainingQueueSizeBytes" db:"remaining_queue_size_bytes"` - LatestResponseCode *int32 `json:"latestResponseCode,omitempty" db:"latest_response_code"` - LatestErrorMessage *string `json:"latestErrorMessage,omitempty" db:"latest_error_message"` - DropNonRetryableData bool `json:"dropNonRetryableData" db:"drop_non_retryable_data"` - MaxAgeSeconds int64 `json:"maxAgeSeconds" db:"max_age_seconds"` + ID platform.ID `json:"id" db:"id"` + OrgID platform.ID `json:"orgID" db:"org_id"` + Name string `json:"name" db:"name"` + Description *string `json:"description,omitempty" db:"description"` + RemoteID platform.ID `json:"remoteID" db:"remote_id"` + LocalBucketID platform.ID `json:"localBucketID" db:"local_bucket_id"` + RemoteBucketID *platform.ID `json:"remoteBucketID" db:"remote_bucket_id"` + RemoteBucketName string `json:"RemoteBucketName" db:"remote_bucket_name"` + MaxQueueSizeBytes int64 `json:"maxQueueSizeBytes" db:"max_queue_size_bytes"` + CurrentQueueSizeBytes int64 `json:"currentQueueSizeBytes"` + RemainingBytesToBeSynced int64 `json:"remainingBytesToBeSynced"` + LatestResponseCode *int32 `json:"latestResponseCode,omitempty" db:"latest_response_code"` + LatestErrorMessage *string `json:"latestErrorMessage,omitempty" db:"latest_error_message"` + DropNonRetryableData bool `json:"dropNonRetryableData" db:"drop_non_retryable_data"` + MaxAgeSeconds int64 `json:"maxAgeSeconds" db:"max_age_seconds"` } // ReplicationListFilter is a selection filter for listing replications. diff --git a/replications/service.go b/replications/service.go index f9caf5ad143..460f2240a4d 100644 --- a/replications/service.go +++ b/replications/service.go @@ -135,7 +135,7 @@ func (s *service) ListReplications(ctx context.Context, filter influxdb.Replicat return nil, err } for i := range rs.Replications { - rs.Replications[i].RemainingQueueSizeBytes = rsizes[rs.Replications[i].ID] + rs.Replications[i].RemainingBytesToBeSynced = rsizes[rs.Replications[i].ID] } return rs, nil @@ -208,7 +208,7 @@ func (s *service) GetReplication(ctx context.Context, id platform.ID) (*influxdb if err != nil { return nil, err } - r.RemainingQueueSizeBytes = rsizes[r.ID] + r.RemainingBytesToBeSynced = rsizes[r.ID] return r, nil } @@ -238,7 +238,7 @@ func (s *service) UpdateReplication(ctx context.Context, id platform.ID, request if err != nil { return nil, err } - r.RemainingQueueSizeBytes = rsizes[r.ID] + r.RemainingBytesToBeSynced = rsizes[r.ID] return r, nil } diff --git a/replications/service_test.go b/replications/service_test.go index 53c18fc0560..9b821bf1cbd 100644 --- a/replications/service_test.go +++ b/replications/service_test.go @@ -194,7 +194,7 @@ func TestListReplications(t *testing.T) { for _, r := range got.Replications { require.Equal(t, tt.sizes[r.ID], r.CurrentQueueSizeBytes) - require.Equal(t, tt.rsizes[r.ID], r.RemainingQueueSizeBytes) + require.Equal(t, tt.rsizes[r.ID], r.RemainingBytesToBeSynced) } }) } @@ -394,7 +394,7 @@ func TestGetReplication(t *testing.T) { } require.Equal(t, tt.sizes[got.ID], got.CurrentQueueSizeBytes) - require.Equal(t, tt.rsizes[got.ID], got.RemainingQueueSizeBytes) + require.Equal(t, tt.rsizes[got.ID], got.RemainingBytesToBeSynced) }) }