Skip to content

Commit

Permalink
chore(): added snapshot metrics streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
le-vlad committed Oct 16, 2024
1 parent fac3216 commit 0418bcf
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions internal/impl/postgresql/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,6 @@ file:
}

func TestIntegrationPgMultiVersionsCDCForPgOutputStreamComittedPlugin(t *testing.T) {
// running tests in the look to test different PostgreSQL versions
t.Parallel()
for _, v := range []string{"17", "16", "15", "14", "13", "12", "11", "10"} {
tmpDir := t.TempDir()
pool, err := dockertest.NewPool("")
Expand Down
2 changes: 0 additions & 2 deletions internal/impl/postgresql/pglogicalstream/logical_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ func NewPgStream(config Config) (*Stream, error) {
SnapshotAction: "export",
}, version, stream.snapshotter)
if err != nil {
fmt.Println(err)
fmt.Println("Failed to create replication slot", err.Error())
return nil, err
}
stream.snapshotName = createSlotResult.SnapshotName
Expand Down
1 change: 0 additions & 1 deletion internal/impl/postgresql/pglogicalstream/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func (m *Monitor) readTablesStat(tables []string) error {
results[tableWithoutSchema] = count
}

fmt.Println("Table stat", results)
m.tableStat = results
return nil
}
Expand Down
1 change: 0 additions & 1 deletion internal/impl/postgresql/pglogicalstream/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ func (s *Snapshotter) prepare() error {
return err
}
if _, err := s.pgConnection.Exec(fmt.Sprintf("SET TRANSACTION SNAPSHOT '%s';", s.snapshotName)); err != nil {
fmt.Println("Failed to prepare snapshot", err)
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/impl/postgresql/pglogicalstream/stream_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type StreamMessageChanges struct {
Operation string `json:"operation"`
Schema string `json:"schema"`
Table string `json:"table"`
TableSnapshotProgress *float64 `json:"table_snapshot_progress"`
TableSnapshotProgress *float64 `json:"table_snapshot_progress,omitempty"`
// For deleted messages - there will be old changes if replica identity set to full or empty changes
Data map[string]any `json:"data"`
}
Expand Down

0 comments on commit 0418bcf

Please sign in to comment.