Skip to content

Commit

Permalink
Added debug logging of the chunks in or to be added to the publication
Browse files Browse the repository at this point in the history
  • Loading branch information
noctarius committed Jul 6, 2023
1 parent 15a1930 commit f263964
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions internal/replication/replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,22 @@ func (r *Replicator) StartReplication() *cli.ExitError {

// Get initial list of chunks to add to publication
initialChunkTables := systemCatalog.GetAllChunks()
r.logger.Debugf(
"Necessary chunks: %+v",
supporting.Map(initialChunkTables, func(chunk systemcatalog.SystemEntity) string {
return chunk.TableName()
}),
)

// Filter published chunks to only add new chunks
alreadyPublished, err := replicationContext.ReadPublishedTables()
r.logger.Debugf(
"Chunks already in publication: %+v",
supporting.Map(initialChunkTables, func(chunk systemcatalog.SystemEntity) string {
return chunk.TableName()
}),
)

if err != nil {
return supporting.AdaptError(err, 250)
}
Expand All @@ -161,6 +174,12 @@ func (r *Replicator) StartReplication() *cli.ExitError {
return item.CanonicalName() == other.CanonicalName()
})
})
r.logger.Debugf(
"Chunks to be added publication: %+v",
supporting.Map(initialChunkTables, func(chunk systemcatalog.SystemEntity) string {
return chunk.TableName()
}),
)

if err := replicationChannel.StartReplicationChannel(replicationContext, initialChunkTables); err != nil {
return supporting.AdaptError(err, 16)
Expand Down
2 changes: 1 addition & 1 deletion internal/systemcatalog/systemcatalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func initializeSystemCatalog(sc *SystemCatalog) (*SystemCatalog, error) {
// Run basic access check based on user permissions
access, err := sc.replicationContext.HasTablePrivilege(hypertable, context.Select)
if err != nil {
return err
return errors.Wrap(err, 0)
}
if !access {
return errors.Errorf("Hypertable %s not accessible", hypertable.CanonicalName())
Expand Down

0 comments on commit f263964

Please sign in to comment.