SIGN IN SIGN UP

core, store: Create postponed indexes when approaching chain head

Add a trigger that creates postponed indexes when a subgraph gets
within a configurable number of blocks (default 10000) of the chain
head. This ensures indexes are in place before the subgraph starts
serving queries.

The new env var GRAPH_POSTPONE_INDEXES_CREATION_THRESHOLD controls
how many blocks before the chain head to trigger index creation. The
creation is idempotent (IF NOT EXISTS + CONCURRENTLY) and only
attempted once per subgraph run via an AtomicBool guard.
D
David Lutterkort committed
14295ebd326eb207f709b35411a9d838c668814c
Parent: 2ef92e7