Commit a6a767c9 authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'master' into t

* master: (79 commits)
  go/zodb/zodbtools: Regenerate test data + fix
  go/zodb/fs1: Regenerate
  go/neo/proto: Regenerate
  go/neo/proto: Fix protogen to work without prior `go install`
  go/*: Add Unwrap to custom errors that have Cause
  go/zodb/btree: Represent a tree node - either BTree or Bucket - by Node
  go/zodb: Cosmetics
  go/zodb: LiveCache: Reclassify all objects on cache control change
  go/zodb: LiveCache: Allow objects to be pinned / omitted from the cache
  go/zodb: Prepare to rework/fix LiveCache control
  go/zodb: persistent tests: Factor test database setup out of TestPersistentDB
  go/zodb: persistent test: Fix thinko in tPersistentDB.checkObj
  go/zodb: Don't expose LiveCache internal organization onto its users
  go/zodb: OpenStorage -> Open
  go/zodb: LastTid -> Sync + Head
  go/zodb: DB: preserve δtail not to go down to ø slice on seldom commits
  go/zodb: ΔTail += Data()
  go/zodb/*: Cosmetics, typos, ...
  go/zodb: Connection.Resync
  go/zodb: DB: handle invalidations
  ...
parents ab540d6e 84845c97
// Copyright (C) 2016-2018 Nexedi SA and Contributors.
// Copyright (C) 2016-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
......@@ -145,7 +145,11 @@ func (li *localImporter) Import(path string) (*types.Package, error) {
// importer instance - only 1 so that for 2 top-level packages same dependent
// packages are not reimported several times.
var localImporterObj = &localImporter{importer.Default()}
//
// don't use importer.Default - this importer uses only binaries for installed
// packages, which might a) get stale wrt sources, or b) be completely missing.
// https://github.com/golang/go/issues/11415
var localImporterObj = &localImporter{importer.For("source", nil)}
func loadPkg(pkgPath string, sources ...string) *types.Package {
var filev []*ast.File
......
......@@ -4,6 +4,24 @@ package proto
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[ACK-0]
_ = x[NOT_READY-1]
_ = x[OID_NOT_FOUND-2]
_ = x[TID_NOT_FOUND-3]
_ = x[OID_DOES_NOT_EXIST-4]
_ = x[PROTOCOL_ERROR-5]
_ = x[REPLICATION_ERROR-6]
_ = x[CHECKING_ERROR-7]
_ = x[BACKEND_NOT_IMPLEMENTED-8]
_ = x[NON_READABLE_CELL-9]
_ = x[READ_ONLY_ACCESS-10]
_ = x[INCOMPLETE_TRANSACTION-11]
}
const _ErrorCode_name = "ACKNOT_READYOID_NOT_FOUNDTID_NOT_FOUNDOID_DOES_NOT_EXISTPROTOCOL_ERRORREPLICATION_ERRORCHECKING_ERRORBACKEND_NOT_IMPLEMENTEDNON_READABLE_CELLREAD_ONLY_ACCESSINCOMPLETE_TRANSACTION"
var _ErrorCode_index = [...]uint8{0, 3, 12, 25, 38, 56, 70, 87, 101, 124, 141, 157, 179}
......@@ -14,6 +32,18 @@ func (i ErrorCode) String() string {
}
return _ErrorCode_name[_ErrorCode_index[i]:_ErrorCode_index[i+1]]
}
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[ClusterRecovering-0]
_ = x[ClusterVerifying-1]
_ = x[ClusterRunning-2]
_ = x[ClusterStopping-3]
_ = x[STARTING_BACKUP-4]
_ = x[BACKINGUP-5]
_ = x[STOPPING_BACKUP-6]
}
const _ClusterState_name = "ClusterRecoveringClusterVerifyingClusterRunningClusterStoppingSTARTING_BACKUPBACKINGUPSTOPPING_BACKUP"
......@@ -25,6 +55,15 @@ func (i ClusterState) String() string {
}
return _ClusterState_name[_ClusterState_index[i]:_ClusterState_index[i+1]]
}
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[MASTER-0]
_ = x[STORAGE-1]
_ = x[CLIENT-2]
_ = x[ADMIN-3]
}
const _NodeType_name = "MASTERSTORAGECLIENTADMIN"
......@@ -36,6 +75,15 @@ func (i NodeType) String() string {
}
return _NodeType_name[_NodeType_index[i]:_NodeType_index[i+1]]
}
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[UNKNOWN-0]
_ = x[DOWN-1]
_ = x[RUNNING-2]
_ = x[PENDING-3]
}
const _NodeState_name = "UNKNOWNDOWNRUNNINGPENDING"
......@@ -47,6 +95,16 @@ func (i NodeState) String() string {
}
return _NodeState_name[_NodeState_index[i]:_NodeState_index[i+1]]
}
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[UP_TO_DATE-0]
_ = x[OUT_OF_DATE-1]
_ = x[FEEDING-2]
_ = x[DISCARDED-3]
_ = x[CORRUPTED-4]
}
const _CellState_name = "UP_TO_DATEOUT_OF_DATEFEEDINGDISCARDEDCORRUPTED"
......
// Code generated by gen-fsbtree from github.com/cznic/b 93348d0; DO NOT EDIT.
// Code generated by gen-fsbtree from github.com/cznic/b 8c9698d; DO NOT EDIT.
// (from patched version available at https://lab.nexedi.com/kirr/b.git)
//
// KEY=zodb.Oid VALUE=int64
......
// Code generated by gen-fsbtree from github.com/cznic/b 93348d0; DO NOT EDIT.
// Code generated by gen-fsbtree from github.com/cznic/b 8c9698d; DO NOT EDIT.
// (from patched version available at https://lab.nexedi.com/kirr/b.git)
//
// ---- 8< ----
......
// Copyright (C) 2016-2019 Nexedi SA and Contributors.
// Copyright (C) 2016-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
......@@ -72,8 +72,6 @@ type dumper struct {
W io.Writer
HashOnly bool // whether to dump only hashes of data without content
afterFirst bool // true after first transaction has been dumped
buf xfmt.Buffer // reusable data buffer for formatting
}
......@@ -152,15 +150,8 @@ func (d *dumper) DumpTxn(ctx context.Context, txni *zodb.TxnInfo, dataIter zodb.
var datai *zodb.DataInfo
// LF in-between txn records
vskip := "\n"
if !d.afterFirst {
vskip = ""
d.afterFirst = true
}
_, err = fmt.Fprintf(d.W, "%stxn %s %q\nuser %q\ndescription %q\nextension %q\n",
vskip, txni.Tid, string(txni.Status), txni.User, txni.Description, txni.Extension)
_, err = fmt.Fprintf(d.W, "txn %s %q\nuser %q\ndescription %q\nextension %q\n",
txni.Tid, string(txni.Status), txni.User, txni.Description, txni.Extension)
if err != nil {
return err
}
......@@ -170,18 +161,19 @@ func (d *dumper) DumpTxn(ctx context.Context, txni *zodb.TxnInfo, dataIter zodb.
datai, err = dataIter.NextData(ctx)
if err != nil {
if err == io.EOF {
err = nil // XXX -> okEOF ?
break
}
break
return err
}
err = d.DumpData(datai)
if err != nil {
break
return err
}
}
_, err = d.W.Write(_LF)
return err
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment