Compare commits

...

3 Commits

Author SHA1 Message Date
Hector Sanjuan
59caa555b4 Changelog for v1.0.8
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1s
Publish Docker image / build-and-push-image (push) Failing after 1s
Tests / All modules + Coverage (push) Failing after 1s
Tests / Using Raft (push) Failing after 1s
Tests / Using LevelDB (push) Failing after 1s
Tests / Using Badger3 (push) Failing after 1s
Tests / Using Badger (push) Failing after 1s
Tests / Build, syntax and spelling checks (push) Failing after 1s
Tests / Docker build (push) Failing after 1s
Tests / Docker Compose (push) Failing after 1s
Tests / Sharness (push) Failing after 1s
2024-03-03 19:25:21 -06:00
Hector Sanjuan
289a635105 ipfsproxy: do not pre-resolve dns addrs / support api over unix sockets
These two changes were made to the ipfshttp connector already.

First, node_multiaddress should not be pre-resolved, only using the first result of the resolution.

Second, we should support node_multiaddresses that are pointing to unix sockets, as the kubo daemon can listen to requests that way and
it is better than tcp for local requests.
2024-03-03 19:25:21 -06:00
Hector Sanjuan
61644365e0 pebble: Set default format_major_version to the newest
Additionally, add a warning when not using the newest version.
2024-03-03 19:25:21 -06:00
4 changed files with 112 additions and 21 deletions

View File

@ -1,5 +1,74 @@
# IPFS Cluster Changelog
### v1.0.8 - 2024-01-30
IPFS Cluster v1.0.8 is a maintenance release.
This release updates dependencies (latest boxo and libp2p) and should bring a couple of Pebble-related improvements:
* We have upgraded Pebble's version. Some users have reported deadlocks in writes to Pebble ([ipfs/ipfs-cluster#2009](https://github.com/ipfs/ipfs-cluster/issues/2009)) and this seems to have helped.
* Pebble now supports 32-bit so it can be the default for all archs.
* We added a warning when Pebble's newest `MajorFormatVersion` is higher than
what is used in the configuration. **Users should increase their `major_format_version`
to maintain forward-compatibility with future versions of Pebble.**
Additionally, some bugs have been fixed and a couple of useful features added, as mentioned below.
#### List of changes
##### Breaking changes
There are no breaking changes on this release.
##### Features
* ipfshttp: support talking to Kubo over unix sockets | [ipfs/ipfs-cluster#1999](https://github.com/ipfs/ipfs-cluster/issues/1999)
* ipfsproxy: support talking to Kubo over unix sockets | [ipfs/ipfs-cluster#2027](https://github.com/ipfs/ipfs-cluster/issues/2027)
* pebble: enable in all archs as default datastore | [ipfs/ipfs-cluster#2005](https://github.com/ipfs/ipfs-cluster/issues/2005) | [ipfs/ipfs-cluster#2007](https://github.com/ipfs/ipfs-cluster/issues/2007)
* pebble: set default MajorVersionFormat to newest | [ipfs/ipfs-cluster#2019](https://github.com/ipfs/ipfs-cluster/issues/2019)
* cluster: Announce and NoAnnounce options | [ipfs/ipfs-cluster#952](https://github.com/ipfs/ipfs-cluster/issues/952) | [ipfs/ipfs-cluster#2010](https://github.com/ipfs/ipfs-cluster/issues/2010)
##### Bug fixes
* ipfs-cluster-follow: issue numpin and pinqueue metrics to other peers | [ipfs/ipfs-cluster#2011](https://github.com/ipfs/ipfs-cluster/issues/2011) | [ipfs/ipfs-cluster#2016](https://github.com/ipfs/ipfs-cluster/issues/2016)
* ipfshttp: do no pre-resolve node_multiaddresses | [ipfs/ipfs-cluster#2004](https://github.com/ipfs/ipfs-cluster/issues/2004) | [ipfs/ipfs-cluster#2017](https://github.com/ipfs/ipfs-cluster/issues/2017)
* ipfsproxy: do no pre-resolve node_multiaddresses | [ipfs/ipfs-cluster#2027](https://github.com/ipfs/ipfs-cluster/issues/2027)
* pebble: deadlock | [ipfs/ipfs-cluster#2009](https://github.com/ipfs/ipfs-cluster/issues/2009)
##### Other changes
* The `Dockerfile-bundle` file has been removed (unmaintained) | [ipfs/ipfs-cluster#1986](https://github.com/ipfs/ipfs-cluster/issues/1986)
* Dependency upgrades | [ipfs/ipfs-cluster#2007](https://github.com/ipfs/ipfs-cluster/issues/2007) | [ipfs/ipfs-cluster#2018](https://github.com/ipfs/ipfs-cluster/issues/2018) | [ipfs/ipfs-cluster#2026](https://github.com/ipfs/ipfs-cluster/issues/2026)
#### Upgrading notices
##### Configuration changes
Two new options have been added to forcefully control the cluster peer libp2p host address announcements: `cluster.announce_multiaddress` and `cluster.no_announce_multiaddress`. Both take a slice of multiaddresses.
##### REST API
No changes.
##### Pinning Service API
No changes.
##### IPFS Proxy API
No changes.
##### Go APIs
No relevant changes.
##### Other
Nothing.
---
### v1.0.7 - 2023-10-12
IPFS Cluster v1.0.7 is a maintenance release.

View File

@ -24,6 +24,7 @@ import (
"github.com/ipfs-cluster/ipfs-cluster/adder/adderutils"
"github.com/ipfs-cluster/ipfs-cluster/api"
"github.com/ipfs-cluster/ipfs-cluster/rpcutil"
"github.com/tv42/httpunix"
handlers "github.com/gorilla/handlers"
mux "github.com/gorilla/mux"
@ -33,7 +34,6 @@ import (
logging "github.com/ipfs/go-log/v2"
rpc "github.com/libp2p/go-libp2p-gorpc"
peer "github.com/libp2p/go-libp2p/core/peer"
madns "github.com/multiformats/go-multiaddr-dns"
manet "github.com/multiformats/go-multiaddr/net"
"go.opencensus.io/plugin/ochttp"
@ -58,13 +58,16 @@ type Server struct {
ctx context.Context
cancel func()
config *Config
nodeScheme string
nodeAddr string
config *Config
nodeScheme string
nodeAddr string
nodeNetwork string
rpcClient *rpc.Client
rpcReady chan struct{}
transport http.RoundTripper // to the proxied kubo RPC API
listeners []net.Listener // proxy listener
server *http.Server // proxy server
reverseProxy *httputil.ReverseProxy // allows to talk to IPFS
@ -111,24 +114,23 @@ func New(cfg *Config) (*Server, error) {
return nil, err
}
nodeMAddr := cfg.NodeAddr
// dns multiaddresses need to be resolved first
if madns.Matches(nodeMAddr) {
ctx, cancel := context.WithTimeout(context.Background(), DNSTimeout)
defer cancel()
resolvedAddrs, err := madns.Resolve(ctx, cfg.NodeAddr)
if err != nil {
logger.Error(err)
return nil, err
}
nodeMAddr = resolvedAddrs[0]
}
_, nodeAddr, err := manet.DialArgs(nodeMAddr)
nodeNetwork, nodeAddr, err := manet.DialArgs(cfg.NodeAddr)
if err != nil {
return nil, err
}
transport := http.DefaultTransport
if nodeNetwork == "unix" {
unixTransport := &httpunix.Transport{
DialTimeout: time.Second,
}
unixTransport.RegisterLocation("ipfs", nodeAddr)
t := &http.Transport{}
t.RegisterProtocol(httpunix.Scheme, unixTransport)
transport = t
}
var listeners []net.Listener
for _, addr := range cfg.ListenAddr {
proxyNet, proxyAddr, err := manet.DialArgs(addr)
@ -195,14 +197,16 @@ func New(cfg *Config) (*Server, error) {
s.SetKeepAlivesEnabled(true) // A reminder that this can be changed
reverseProxy := httputil.NewSingleHostReverseProxy(proxyURL)
reverseProxy.Transport = http.DefaultTransport
reverseProxy.Transport = transport
ctx, cancel := context.WithCancel(context.Background())
proxy := &Server{
ctx: ctx,
config: cfg,
cancel: cancel,
nodeAddr: nodeHTTPAddr,
nodeNetwork: nodeNetwork,
nodeScheme: nodeScheme,
transport: transport,
rpcReady: make(chan struct{}, 1),
listeners: listeners,
server: s,

View File

@ -66,7 +66,8 @@ var (
// DefaultFilterPolicy defines the number of bits used per key for
// bloom filters. 10 yields a 1% false positive rate.
DefaultFilterPolicy bloom.FilterPolicy = 10 // Pebble's default: 10
// DefaultFormatMajorVersion sets the format of Pebble on-disk files.
DefaultFormatMajorVersion = pebble.FormatNewest
)
func init() {
@ -219,6 +220,7 @@ func (cfg *Config) Default() error {
cfg.PebbleOptions = DefaultPebbleOptions
cache := pebble.NewCache(DefaultCacheSize)
cfg.PebbleOptions.Cache = cache
cfg.PebbleOptions.FormatMajorVersion = DefaultFormatMajorVersion
cfg.PebbleOptions.MemTableSize = DefaultMemTableSize
cfg.PebbleOptions.MemTableStopWritesThreshold = DefaultMemTableStopWritesThreshold
cfg.PebbleOptions.BytesPerSync = DefaultBytesPerSync

View File

@ -7,6 +7,7 @@ import (
"os"
"time"
"github.com/cockroachdb/pebble"
ds "github.com/ipfs/go-datastore"
pebbleds "github.com/ipfs/go-ds-pebble"
logging "github.com/ipfs/go-log/v2"
@ -24,6 +25,19 @@ func New(cfg *Config) (ds.Datastore, error) {
return nil, errors.Wrap(err, "creating pebble folder")
}
// Deal with Pebble updates... user should try to be up to date with
// latest Pebble table formats.
fmv := cfg.PebbleOptions.FormatMajorVersion
newest := pebble.FormatNewest
if fmv < newest {
logger.Warnf(`Pebble's format_major_version is set to %d, but newest version is %d.
It is recommended to increase format_major_version and restart. If an error
occurrs when increasing the number several versions at once, it may help to
increase them one by one, restarting the daemon every time.
`, fmv, newest)
}
db, err := pebbleds.NewDatastore(folder, &cfg.PebbleOptions)
if err != nil {
return nil, err
@ -32,11 +46,13 @@ func New(cfg *Config) (ds.Datastore, error) {
// Calling regularly DB's DiskUsage is a way to printout debug
// database statistics.
go func() {
ctx := context.Background()
db.DiskUsage(ctx)
ticker := time.NewTicker(time.Minute)
defer ticker.Stop()
for {
<-ticker.C
db.DiskUsage(context.Background())
db.DiskUsage(ctx)
}
}()
return db, nil