You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the tracking issue for the graph db SQL-ization project. It will be the go-to reference to see how the project is progressing.
I'll start with a check-list for easy reference & then will add any details & context lower down behind some drop-down tags.
High Level Project Check List
Prepare the code (exported methods and tests) such that everything is DB agnostic (ie, hide db specific types and behaviour) in preparation for having things ready to be run against a different DB backend.
Introduce an abstract graph DB interface & let the ChannelGraph use this interface instead of a raw pointer.
Introduce SQL schema, queries & CRUD
Implement the kvdb -> SQL migration for the above stores.
Plug the new migration into the main code base & add itest jobs to run against them (behind a feature flag s.t they are not yet available in prod build).
Once there is enough confidence in the code & migration, add the SQL impl & migrations to the main prod build
Lower Level Check Lists
1. Prep graph DB code to be ready for new db backend
We'll define the schemas, queries and implement the crud required for each of the following data strucutres:
nodes
channels
channel updates
zombies
source nodes
closed SCIDs
prune log
Note that this will be done in an incremental fashion s.t we are implementing the SQL impl of the new abstract graph store interface method by method. Here are all the methods that will be converted:
AddLightningNode
AddrsForNode
ForEachSourceNodeChannel
ForEachNodeChannel
ForEachNodeCached
ForEachNode
ForEachNodeCacheable
LookupAlias
DeleteLightningNode
NodeUpdatesInHorizon
FetchLightningNode
HasLightningNode
IsPublicNode
GraphSession
ForEachChannel
DisabledChannelIDs
AddChannelEdge
HasChannelEdge
DeleteChannelEdges
AddEdgeProof
ChannelID
HighestChanID
ChanUpdatesInHorizon
FilterKnownChanIDs
FilterChannelRange
FetchChanInfos
FetchChannelEdgesByOutpoint
FetchChannelEdgesByID
ChannelView
MarkEdgeZombie
MarkEdgeLive
IsZombieEdge
NumZombies
PutClosedScid
IsClosedScid
UpdateEdgePolicy
SourceNode
SetSourceNode
PruneTip
PruneGraphNodes
PruneGraph
DisconnectBlockAtHeight
Once all the above is complete we can:
run the full uint test suite against the SQL graph impls
run the full itest suite against the SQL graph impls
4. Migration
- write the migration code for the graph store along with a test for it
- plug in to code behind a dev feature flag
Planned Schemas:
Nodes
NOTES:
the node_v2_data is only for demonstrating how future gossip V2 data will fit in to the picture
Still up for debate if we want to merge the node_v1_data and node_v2_data tables into the nodes table.
Channels
NOTES:
the channels_v2_data is only for demonstrating how future gossip V2 data will fit in to the picture
Still up for debate if we want to merge the channels_v1_data and channels_v2_data tables into the channels table.
The nodes table here is not complete - it is just to show how channels link to nodes. See "Nodes" section above for details on the nodes table.
Channel Policies
the channel_policy_v2_data is only for demonstrating how future gossip V2 data will fit in to the picture
Still up for debate if we want to merge the channel_policy_v1_data and channel_policy_v2_data tables into the channel_policies table.
The nodes and channels tables here are not complete - it is just to show how channel_policies link to channels and to nodes. See "Nodes" & "Channels" sections above for details on the nodes and `channels tables.
Other Graph Tables
The text was updated successfully, but these errors were encountered:
This is the tracking issue for the graph db SQL-ization project. It will be the go-to reference to see how the project is progressing.
I'll start with a check-list for easy reference & then will add any details & context lower down behind some drop-down tags.
High Level Project Check List
ChannelGraph
use this interface instead of a raw pointer.Lower Level Check Lists
1. Prep graph DB code to be ready for new db backend
This includes removing any
kvdb
types and replacing them with more abstract types.- graph/db: clean up test code in preparation for DB abtraction #9694
- graph+lnwire: start validating that extra lnwire msg bytes are valid TLV #9787
- multi: various test preparations for different graph store impl #9800
- graph/db: add test coverage for all V1Store methods #9796
- graph/db: remove various
kvdb
parameters from exported methods #9695- batch: dont expose kvdb.RwTx in batch.SchedulerOptions #9790
2. Abstract graph DB interface
V1Store
interface #97913. Introduce SQL schema, queries & CRUD
We'll define the schemas, queries and implement the crud required for each of the following data strucutres:
Note that this will be done in an incremental fashion s.t we are implementing the SQL impl of the new abstract graph store interface method by method. Here are all the methods that will be converted:
Once all the above is complete we can:
4. Migration
- write the migration code for the graph store along with a test for it - plug in to code behind a dev feature flag
Planned Schemas:
Nodes
NOTES:
node_v2_data
is only for demonstrating how future gossip V2 data will fit in to the picturenode_v1_data
andnode_v2_data
tables into thenodes
table.Channels
NOTES:
channels_v2_data
is only for demonstrating how future gossip V2 data will fit in to the picturechannels_v1_data
andchannels_v2_data
tables into thechannels
table.nodes
table here is not complete - it is just to show howchannels
link tonodes
. See "Nodes" section above for details on thenodes
table.Channel Policies
channel_policy_v2_data
is only for demonstrating how future gossip V2 data will fit in to the picturechannel_policy_v1_data
andchannel_policy_v2_data
tables into thechannel_policies
table.nodes
andchannels
tables here are not complete - it is just to show howchannel_policies
link tochannels
and tonodes
. See "Nodes" & "Channels" sections above for details on thenodes
and `channels tables.Other Graph Tables
The text was updated successfully, but these errors were encountered: