Documentation
¶
Index ¶
- Constants
- func HandleRangeRequest(ctx context.Context, d ldiff.Diff, req *spacesyncproto.HeadSyncRequest) (resp *spacesyncproto.HeadSyncResponse, err error)
- type Client
- type DiffManager
- func (dm *DiffManager) AllIds() []string
- func (dm *DiffManager) FillDiff(ctx context.Context) error
- func (dm *DiffManager) HandleRangeRequest(ctx context.Context, req *spacesyncproto.HeadSyncRequest) (resp *spacesyncproto.HeadSyncResponse, err error)
- func (dm *DiffManager) TryDiff(ctx context.Context, rdiff RemoteDiff) (newIds, changedIds, removedIds []string, err error)
- func (dm *DiffManager) UpdateHeads(update headstorage.HeadsEntry)
- type DiffSyncer
- type HeadSync
- type RemoteDiff
- type TreeHeads
Constants ¶
const CName = "common.commonspace.headsync"
Variables ¶
This section is empty.
Functions ¶
func HandleRangeRequest ¶
func HandleRangeRequest(ctx context.Context, d ldiff.Diff, req *spacesyncproto.HeadSyncRequest) (resp *spacesyncproto.HeadSyncResponse, err error)
Types ¶
type Client ¶
type Client interface {
HeadSync(ctx context.Context, in *spacesyncproto.HeadSyncRequest) (*spacesyncproto.HeadSyncResponse, error)
}
type DiffManager ¶ added in v0.9.5
type DiffManager struct {
// contains filtered or unexported fields
}
DiffManager holds the current diff (DiffType_V3).
Upgrading the diff algorithm to a next DiffType requires a coexistence period, see how V2/V3 lived together before V2 removal (git history up to this commit): a DiffContainer with old/new diffs filled by DiffManager, dual hashes in statestorage, a switch by req.DiffType in HandleRangeRequest and by resp.DiffType in remote.DiffTypeCheck, so that the newest common type wins. The old type can be dropped once the secureservice compatibleVersions exclude all peers that don't support the new one.
Note for that future upgrade: V3-only responders (this code and the node's HeadSync handler) reject unknown diff types with an error instead of answering with their best supported type, so a V(n+1) requester must treat such an error as "type unsupported" and fall back to requesting V(n).
func NewDiffManager ¶ added in v0.9.5
func NewDiffManager( diff ldiff.Diff, storage spacestorage.SpaceStorage, syncAcl syncacl.SyncAcl, log logger.CtxLogger, ctx context.Context, deletionState deletionstate.ObjectDeletionState, ) *DiffManager
func (*DiffManager) AllIds ¶ added in v0.9.5
func (dm *DiffManager) AllIds() []string
func (*DiffManager) FillDiff ¶ added in v0.9.5
func (dm *DiffManager) FillDiff(ctx context.Context) error
func (*DiffManager) HandleRangeRequest ¶ added in v0.9.5
func (dm *DiffManager) HandleRangeRequest(ctx context.Context, req *spacesyncproto.HeadSyncRequest) (resp *spacesyncproto.HeadSyncResponse, err error)
func (*DiffManager) TryDiff ¶ added in v0.9.5
func (dm *DiffManager) TryDiff(ctx context.Context, rdiff RemoteDiff) (newIds, changedIds, removedIds []string, err error)
func (*DiffManager) UpdateHeads ¶ added in v0.9.5
func (dm *DiffManager) UpdateHeads(update headstorage.HeadsEntry)
type DiffSyncer ¶
type HeadSync ¶
type HeadSync interface {
app.ComponentRunnable
ExternalIds() []string
AllIds() []string
DiffSync(ctx context.Context) error
HandleRangeRequest(ctx context.Context, req *spacesyncproto.HeadSyncRequest) (resp *spacesyncproto.HeadSyncResponse, err error)
}
type RemoteDiff ¶ added in v0.3.11
type RemoteDiff interface {
ldiff.Remote
// DiffTypeCheck asks the remote for its total hash and compares it with the local diff
DiffTypeCheck(ctx context.Context, diff ldiff.Diff) (needsSync bool, err error)
}
func NewRemoteDiff ¶
func NewRemoteDiff(spaceId string, client Client) RemoteDiff
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
mock_headstorage
Package mock_headstorage is a generated GoMock package.
|
Package mock_headstorage is a generated GoMock package. |
|
Package mock_headsync is a generated GoMock package.
|
Package mock_headsync is a generated GoMock package. |
|
mock_statestorage
Package mock_statestorage is a generated GoMock package.
|
Package mock_statestorage is a generated GoMock package. |