-
Notifications
You must be signed in to change notification settings - Fork 93
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
jsonrpc autoconnect, indexes client recovery, docker volumes, bugfixes #68
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -523,7 +523,7 @@ | |
], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some improvements in clarity and new boxes that helped discover some things. |
||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "On-Chain Progress", | ||
"title": "On-Chain Refresh", | ||
"type": "gauge" | ||
}, | ||
{ | ||
|
@@ -597,7 +597,7 @@ | |
"thresholds": "", | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Height", | ||
"title": "Index Height", | ||
"type": "singlestat", | ||
"valueFontSize": "80%", | ||
"valueMaps": [ | ||
|
@@ -684,7 +684,7 @@ | |
"thresholds": "", | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Avg Full-Refresh Duration", | ||
"title": "Full-Refresh Duration", | ||
"type": "singlestat", | ||
"valueFontSize": "80%", | ||
"valueMaps": [ | ||
|
@@ -768,7 +768,7 @@ | |
"thresholds": "", | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Avg Delta-Refresh Duration", | ||
"title": "Delta-Refresh Duration", | ||
"type": "singlestat", | ||
"valueFontSize": "80%", | ||
"valueMaps": [ | ||
|
@@ -828,7 +828,7 @@ | |
], | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Meta Progress", | ||
"title": "Meta Refresh", | ||
"type": "gauge" | ||
}, | ||
{ | ||
|
@@ -884,7 +884,7 @@ | |
], | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Current #Miners on-chain", | ||
"title": "#Miners Ping Reply", | ||
"type": "bargauge" | ||
}, | ||
{ | ||
|
@@ -948,7 +948,7 @@ | |
], | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Full refresh progress", | ||
"title": "Full Refresh", | ||
"type": "gauge" | ||
}, | ||
{ | ||
|
@@ -1022,7 +1022,7 @@ | |
"thresholds": "", | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Last Refresh Duration", | ||
"title": "Refresh Duration", | ||
"type": "singlestat", | ||
"valueFontSize": "80%", | ||
"valueMaps": [ | ||
|
@@ -1032,7 +1032,7 @@ | |
"value": "null" | ||
} | ||
], | ||
"valueName": "current" | ||
"valueName": "avg" | ||
}, | ||
{ | ||
"cacheTimeout": null, | ||
|
@@ -1082,7 +1082,7 @@ | |
], | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Last Query-Ask Response", | ||
"title": "Last Query-Ask Reply", | ||
"type": "bargauge" | ||
}, | ||
{ | ||
|
@@ -1156,8 +1156,92 @@ | |
], | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Refresh Progress", | ||
"title": "Refresh", | ||
"type": "gauge" | ||
}, | ||
{ | ||
"cacheTimeout": null, | ||
"colorBackground": false, | ||
"colorValue": false, | ||
"colors": [ | ||
"#299c46", | ||
"rgba(237, 129, 40, 0.89)", | ||
"#d44a3a" | ||
], | ||
"datasource": null, | ||
"format": "none", | ||
"gauge": { | ||
"maxValue": 100, | ||
"minValue": 0, | ||
"show": false, | ||
"thresholdLabels": false, | ||
"thresholdMarkers": true | ||
}, | ||
"gridPos": { | ||
"h": 4, | ||
"w": 2, | ||
"x": 2, | ||
"y": 15 | ||
}, | ||
"id": 37, | ||
"interval": null, | ||
"links": [], | ||
"mappingType": 1, | ||
"mappingTypes": [ | ||
{ | ||
"name": "value to text", | ||
"value": 1 | ||
}, | ||
{ | ||
"name": "range to text", | ||
"value": 2 | ||
} | ||
], | ||
"maxDataPoints": 100, | ||
"nullPointMode": "connected", | ||
"nullText": null, | ||
"options": {}, | ||
"pluginVersion": "6.5.3", | ||
"postfix": "", | ||
"postfixFontSize": "50%", | ||
"prefix": "", | ||
"prefixFontSize": "50%", | ||
"rangeMaps": [ | ||
{ | ||
"from": "null", | ||
"text": "N/A", | ||
"to": "null" | ||
} | ||
], | ||
"sparkline": { | ||
"fillColor": "rgba(31, 118, 189, 0.18)", | ||
"full": true, | ||
"lineColor": "rgb(31, 120, 193)", | ||
"show": true, | ||
"ymax": null, | ||
"ymin": null | ||
}, | ||
"tableColumn": "", | ||
"targets": [ | ||
{ | ||
"expr": "textilefc_indexslashing_updated_height", | ||
"refId": "A" | ||
} | ||
], | ||
"thresholds": "", | ||
"timeFrom": null, | ||
"timeShift": null, | ||
"title": "Index Height", | ||
"type": "singlestat", | ||
"valueFontSize": "80%", | ||
"valueMaps": [ | ||
{ | ||
"op": "=", | ||
"text": "N/A", | ||
"value": "null" | ||
} | ||
], | ||
"valueName": "avg" | ||
} | ||
], | ||
"refresh": "5s", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ import ( | |
"sync" | ||
"time" | ||
|
||
"github.com/ipfs/go-datastore" | ||
cbor "github.com/ipfs/go-ipld-cbor" | ||
"github.com/textileio/filecoin/fchost" | ||
"github.com/textileio/filecoin/iplocation" | ||
|
@@ -15,7 +14,7 @@ import ( | |
) | ||
|
||
const ( | ||
metadataRefreshInterval = time.Second * 30 | ||
metadataRefreshInterval = time.Second * 45 | ||
pingTimeout = time.Second * 3 | ||
pingRateLim = 100 | ||
) | ||
|
@@ -50,6 +49,7 @@ func (mi *MinerIndex) metaWorker() { | |
newIndex, err := updateMetaIndex(mi.ctx, mi.api, mi.h, mi.lr, addrs) | ||
if err != nil { | ||
log.Errorf("error when updating meta index: %s", err) | ||
break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If for some reason generating a new index fails, log the error and break here. If we continue we would override the current-good-state-index with an empty one and lost things. Better to keep it outdated than to lose it. |
||
} | ||
if err := mi.persistMetaIndex(newIndex); err != nil { | ||
log.Errorf("error when persisting meta index: %s", err) | ||
|
@@ -151,33 +151,3 @@ func (mi *MinerIndex) persistMetaIndex(index MetaIndex) error { | |
} | ||
return nil | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved to |
||
// loadFromDS loads persisted indexes to memory datastructures. No locks needed | ||
// since its only called from New(). | ||
func (mi *MinerIndex) loadFromDS() error { | ||
buf, err := mi.ds.Get(dsKeyMetaIndex) | ||
if err != nil { | ||
if err == datastore.ErrNotFound { | ||
mi.index = Index{ | ||
Meta: MetaIndex{Info: make(map[string]Meta)}, | ||
Chain: ChainIndex{Power: make(map[string]Power)}, | ||
} | ||
return nil | ||
} | ||
return err | ||
} | ||
var metaIndex MetaIndex | ||
if err := cbor.DecodeInto(buf, &metaIndex); err != nil { | ||
return err | ||
} | ||
|
||
var chainIndex ChainIndex | ||
if _, err := mi.store.GetLastCheckpoint(&chainIndex); err != nil { | ||
return err | ||
} | ||
|
||
mi.index.Meta = metaIndex | ||
mi.index.Chain = chainIndex | ||
|
||
return nil | ||
} |
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.
Made a change in the docker-compose used to launch the server, prometheus, grafana, etc.
The
textile-fc
(our service) uses a volume to map the repo folder to a Docker volume. Mostly for saving progress while restarting the compose environment, and tests index persistence.