Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/horizon/internal/expingest: Fix logging in OrderBookStream #2699

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions services/horizon/internal/expingest/orderbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ func addOfferToGraph(graph orderbook.OBGraph, offer history.Offer) {
// update returns true if the order book graph was reset
func (o *OrderBookStream) update(status ingestionStatus) (bool, error) {
reset := o.lastLedger == 0
if status.StateInvalid || !status.HistoryConsistentWithState {
if status.StateInvalid {
log.WithField("status", status).Warn("ingestion state is invalid")
reset = true
} else if !status.HistoryConsistentWithState {
log.WithField("status", status).
Info("ingestion state not consistent with ingested history")
reset = true
} else if status.LastIngestedLedger < o.lastLedger {
log.WithField("status", status).
WithField("last_ledger", o.lastLedger).
Expand All @@ -124,8 +128,6 @@ func (o *OrderBookStream) update(status ingestionStatus) (bool, error) {

// wait until offers in horizon db is valid before populating order book graph
if status.StateInvalid || !status.HistoryConsistentWithState {
log.WithField("status", status).
Info("waiting for ingestion to update offers table")
return true, nil
}

Expand Down