-
Notifications
You must be signed in to change notification settings - Fork 510
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
exp/ingest: verify-range
Horizon command and RangeSession
#1890
Conversation
c6e15dc
to
133696e
Compare
verify-state
Horizon command and RangeSession
verify-state
Horizon command and RangeSessionverify-range
Horizon command and RangeSession
@@ -178,3 +213,106 @@ func (r reporterLedgerReader) GetUpgradeChanges() []io.Change { | |||
|
|||
return reader.GetUpgradeChanges() | |||
} | |||
|
|||
// initState initialilizes the state using given arguments. Common code for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// initState initialilizes the state using given arguments. Common code for | |
// initState initializes the state using given arguments. Common code for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
stateReader = reporterStateReader{stateReader, stateReporter} | ||
} | ||
|
||
errChan := statePipeline.Process(stateReader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bartekn it seems like this could be nil
shall we check if this was passed or not before calling process?
@@ -3,6 +3,8 @@ DATABASE=postgresql://user=postgres password=mysecretpassword host=host.docker.i | |||
compat_minimal_PEER_PORT=11625 | |||
compat_minimal_HTTP_PORT=11626 | |||
|
|||
AUTOMATIC_MAINTENANCE_COUNT=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason for this update?
// ledgers. It checks if the state is correct. If another go routine is already | ||
// running it exits. | ||
func (s *System) verifyState(graphOffers map[xdr.Int64]xdr.OfferEntry) error { | ||
// ledgers. It runs global verifyState inside. If another go routine is already |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we reframe this a little bit like:
"It will exit if another go routine is already running or the ledger sequence is old (ex. catching up)"?
Closed in favour of #2086 (easier to do when |
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
Adds
horizon expingest verify-range
command andexp/ingest.RangeSession
.Close #1848.
Why
In order to ensure that new ingestion system works correctly we plan to reingest pubnet history from the first ledger. In order to achieve this we add
horizon expingest verify-range
command that accepts required two params:--from
and--to
that describe the ledger range. When started it:from
ledger (must be a checkpoint ledger).[from+1, to]
.verifyState
function onto
ledger (must be a checkpoint ledger when--verify-state
).When merged we can start multiple workers ingesting full history in parallel like:
Internally, it's using a new
RangeSession
fromexp/ingest
package that process a given range of ledger.RangeSession
will be also used inhorizon reingest
commands.It's also helpful for finding performance issues as it's easy to reingest a given range with a debug server enabled.
Known limitations
A small update to
db.Session
was needed. When usingSession.BeginTx
,Ctx
onSession
must be set, otherwise it panics withpanic: runtime error: invalid memory address or nil pointer dereference
indatabase/sql/sql.go:1140
.db.Open
function does not setCtx
.