Skip to content

Commit

Permalink
Merge branch 'develop' into orpheus/ci/commit-title-length
Browse files Browse the repository at this point in the history
  • Loading branch information
orpheuslummis authored Mar 16, 2023
2 parents 5b14c06 + eb1fae4 commit 757626f
Show file tree
Hide file tree
Showing 37 changed files with 3,240 additions and 3,091 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Obtain a specific commit by its content identifier (`cid`):
```gql
defradb client query '
query {
commit(cid: "bafybeidembipteezluioakc2zyke4h5fnj4rr3uaougfyxd35u3qzefzhm") {
commits(cid: "bafybeidembipteezluioakc2zyke4h5fnj4rr3uaougfyxd35u3qzefzhm") {
cid
delta
height
Expand Down
4 changes: 3 additions & 1 deletion core/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ func (source *DocumentMapping) CloneWithoutRender() *DocumentMapping {
}

for i, childMapping := range source.ChildMappings {
result.ChildMappings[i] = childMapping.CloneWithoutRender()
if childMapping != nil {
result.ChildMappings[i] = childMapping.CloneWithoutRender()
}
}

return &result
Expand Down
13 changes: 2 additions & 11 deletions datastore/memory/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ import "github.com/sourcenetwork/defradb/errors"
var (
ErrReadOnlyTxn = errors.New("read only transaction")
ErrTxnDiscarded = errors.New("transaction discarded")
ErrTxnConflict = txnConflictError{errors.New("transaction conflict")}
//nolint:revive
ErrTxnConflict = errors.New("Transaction Conflict. Please retry")
)

type txnConflictError struct {
error
}

// custom error formatting that is non idiomatic but matches the
// Badger transaction conflict message
func (e txnConflictError) Error() string {
return "Transaction Conflict. Please retry"
}
9 changes: 8 additions & 1 deletion net/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func NewPeer(

// Start all the internal workers/goroutines/loops that manage the P2P state.
func (p *Peer) Start() error {
p.mu.Lock()
defer p.mu.Unlock()

p2plistener, err := gostream.Listen(p.host, corenet.Protocol)
if err != nil {
return err
Expand Down Expand Up @@ -678,7 +681,11 @@ func (p *Peer) pushLogToReplicators(ctx context.Context, lg events.Update) {
peers[peer.String()] = struct{}{}
}

if reps, exists := p.replicators[lg.SchemaID]; exists {
p.mu.Lock()
reps, exists := p.replicators[lg.SchemaID]
p.mu.Unlock()

if exists {
for pid := range reps {
// Don't push if pid is in the list of peers for the topic.
// It will be handled by the pubsub system.
Expand Down
Loading

0 comments on commit 757626f

Please sign in to comment.