Git Product home page Git Product logo

Comments (4)

gyuho avatar gyuho commented on May 27, 2024

https://github.com/coreos/etcd/blob/master/mvcc/kvstore.go#L325-L328 calls

func (s *store) Hash() (uint32, int64, error) {
    s.mu.Lock()
    defer s.mu.Unlock()
    s.b.ForceCommit()

t.tx.Size() in https://github.com/coreos/etcd/blob/master/mvcc/backend/batch_tx.go#L158 triggers nil reference. And in boltdb

func (tx *Tx) Size() int64 {
    // tx.meta == nil, tx.db == nil
    return int64(tx.meta.pgid) * int64(tx.db.pageSize)
}

from etcdlabs.

gyuho avatar gyuho commented on May 27, 2024

https://github.com/boltdb/bolt/blob/master/tx.go#L228 calls

func (tx *Tx) Commit() error {

    // Finalize the transaction.
    tx.close()

And tx.close() clears these references

func (tx *Tx) close() {

    // Clear all references.
    tx.db = nil
    tx.meta = nil
    tx.root = Bucket{tx: tx}
    tx.pages = nil

So the concurrent Size calls would panic

func (tx *Tx) Size() int64 {
    // tx.meta == nil, tx.db == nil
    return int64(tx.meta.pgid) * int64(tx.db.pageSize)
}
panic: runtime error: invalid memory address or nil pointer dereference

from etcdlabs.

gyuho avatar gyuho commented on May 27, 2024

Reported boltdb/bolt#606

from etcdlabs.

gyuho avatar gyuho commented on May 27, 2024
2016-10-18 22:05:38.169780 N | etcdserver/membership: set the initial cluster version to 3.0
2016-10-18 22:05:38.171350 I | embed: ready to serve client requests
2016-10-18 22:05:38.171406 I | cluster: started node5 (client https://localhost:2387, peer http://localhost:2388)
2016-10-18 22:05:38.171440 I | etcdserver: published {Name:node5 ClientURLs:[https://localhost:2387]} to cluster 8e2dba8947ec7350
2016-10-18 22:05:38.171760 I | embed: serving client requests on 127.0.0.1:2387
2016-10-18 22:05:39.171653 I | cluster: checking leader
2016-10-18 22:05:39.312288 I | cluster: node4 8b589464afef20da has leader 8e9e05c52164694d
2016-10-18 22:05:39.313426 I | cluster: node1 8e9e05c52164694d has leader 8e9e05c52164694d
2016-10-18 22:05:39.316897 I | cluster: node2 7e3bd17c66e004e8 has leader 8e9e05c52164694d
2016-10-18 22:05:39.316959 I | cluster: node3 fa252746f913ab7f has leader 8e9e05c52164694d
2016-10-18 22:05:39.319706 I | cluster: node5 7f6f18ba4a949731 has leader 8e9e05c52164694d
2016-10-18 22:05:39.319737 I | cluster: successfully started 5 nodes
2016-10-18 22:05:39.319785 I | backend: started server http://localhost:2200
2016-10-18 22:05:42.017896 I | etcdserver: updating the cluster version from 3.0 to 3.1
2016-10-18 22:05:42.020833 N | etcdserver/membership: updated the cluster version from 3.0 to 3.1
2016-10-18 22:05:42.020975 N | etcdserver/membership: updated the cluster version from 3.0 to 3.1
2016-10-18 22:05:42.021018 N | etcdserver/membership: updated the cluster version from 3.0 to 3.1
2016-10-18 22:05:42.021111 N | etcdserver/membership: updated the cluster version from 3.0 to 3.1
2016-10-18 22:05:42.021149 I | etcdserver/api: enabled capabilities for version 3.1
2016-10-18 22:05:42.021229 N | etcdserver/membership: updated the cluster version from 3.0 to 3.1
2016-10-18 22:06:15.212550 I | backend: just created user "127001linuxchrome0fXC44tislWbVXi"
2016-10-18 22:06:18.826029 I | backend: user "127001linuxchrome0fXC44tislWbVXi" just left (user deleted)
2016-10-18 22:37:53.032401 I | backend: just created user "127001linuxchrome0fXC44tislWbVXi"
2016-10-18 22:37:54.787403 I | backend: user "127001linuxchrome0fXC44tislWbVXi" just left (user deleted)
2016-10-18 22:37:55.704386 I | backend: just created user "127001linuxchrome0fXC44tislWbVXi"
2016-10-18 22:37:58.420367 I | cluster: stopping node1
2016-10-18 22:37:58.420413 I | rafthttp: stopping peer 7e3bd17c66e004e8...
2016-10-18 22:37:58.420618 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream MsgApp v2 reader)
2016-10-18 22:37:58.420666 I | rafthttp: closed the TCP streaming connection with peer 7e3bd17c66e004e8 (stream MsgApp v2 writer)
2016-10-18 22:37:58.420674 I | rafthttp: stopped streaming with peer 7e3bd17c66e004e8 (writer)
2016-10-18 22:37:58.420827 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream Message reader)
2016-10-18 22:37:58.420893 I | rafthttp: closed the TCP streaming connection with peer 7e3bd17c66e004e8 (stream Message writer)
2016-10-18 22:37:58.420900 I | rafthttp: stopped streaming with peer 7e3bd17c66e004e8 (writer)
2016-10-18 22:37:58.420922 I | rafthttp: stopped HTTP pipelining with peer 7e3bd17c66e004e8
2016-10-18 22:37:58.420967 W | rafthttp: lost the TCP streaming connection with peer 7e3bd17c66e004e8 (stream MsgApp v2 reader)
2016-10-18 22:37:58.420980 I | rafthttp: stopped streaming with peer 7e3bd17c66e004e8 (stream MsgApp v2 reader)
2016-10-18 22:37:58.421050 W | rafthttp: lost the TCP streaming connection with peer 7e3bd17c66e004e8 (stream Message reader)
2016-10-18 22:37:58.421060 I | rafthttp: stopped streaming with peer 7e3bd17c66e004e8 (stream Message reader)
2016-10-18 22:37:58.421067 I | rafthttp: stopped peer 7e3bd17c66e004e8
2016-10-18 22:37:58.421073 I | rafthttp: stopping peer 7f6f18ba4a949731...
2016-10-18 22:37:58.421335 I | rafthttp: closed the TCP streaming connection with peer 7f6f18ba4a949731 (stream MsgApp v2 writer)
2016-10-18 22:37:58.421344 I | rafthttp: stopped streaming with peer 7f6f18ba4a949731 (writer)
2016-10-18 22:37:58.421595 I | rafthttp: closed the TCP streaming connection with peer 7f6f18ba4a949731 (stream Message writer)
2016-10-18 22:37:58.421602 I | rafthttp: stopped streaming with peer 7f6f18ba4a949731 (writer)
2016-10-18 22:37:58.421617 I | rafthttp: stopped HTTP pipelining with peer 7f6f18ba4a949731
2016-10-18 22:37:58.421657 W | rafthttp: lost the TCP streaming connection with peer 7f6f18ba4a949731 (stream MsgApp v2 reader)
2016-10-18 22:37:58.421663 I | rafthttp: stopped streaming with peer 7f6f18ba4a949731 (stream MsgApp v2 reader)
2016-10-18 22:37:58.421685 W | rafthttp: lost the TCP streaming connection with peer 7f6f18ba4a949731 (stream Message reader)
2016-10-18 22:37:58.421690 I | rafthttp: stopped streaming with peer 7f6f18ba4a949731 (stream Message reader)
2016-10-18 22:37:58.421694 I | rafthttp: stopped peer 7f6f18ba4a949731
2016-10-18 22:37:58.421698 I | rafthttp: stopping peer 8b589464afef20da...
2016-10-18 22:37:58.421947 I | rafthttp: closed the TCP streaming connection with peer 8b589464afef20da (stream MsgApp v2 writer)
2016-10-18 22:37:58.421953 I | rafthttp: stopped streaming with peer 8b589464afef20da (writer)
2016-10-18 22:37:58.422195 I | rafthttp: closed the TCP streaming connection with peer 8b589464afef20da (stream Message writer)
2016-10-18 22:37:58.422201 I | rafthttp: stopped streaming with peer 8b589464afef20da (writer)
2016-10-18 22:37:58.422219 I | rafthttp: stopped HTTP pipelining with peer 8b589464afef20da
2016-10-18 22:37:58.422263 W | rafthttp: lost the TCP streaming connection with peer 8b589464afef20da (stream MsgApp v2 reader)
2016-10-18 22:37:58.422272 E | rafthttp: failed to read 8b589464afef20da on stream MsgApp v2 (net/http: request canceled)
2016-10-18 22:37:58.422297 I | rafthttp: peer 8b589464afef20da became inactive
2016-10-18 22:37:58.422304 I | rafthttp: stopped streaming with peer 8b589464afef20da (stream MsgApp v2 reader)
2016-10-18 22:37:58.422339 W | rafthttp: lost the TCP streaming connection with peer 8b589464afef20da (stream Message reader)
2016-10-18 22:37:58.422348 I | rafthttp: stopped streaming with peer 8b589464afef20da (stream Message reader)
2016-10-18 22:37:58.422354 I | rafthttp: stopped peer 8b589464afef20da
2016-10-18 22:37:58.422359 I | rafthttp: stopping peer fa252746f913ab7f...
2016-10-18 22:37:58.422687 I | rafthttp: closed the TCP streaming connection with peer fa252746f913ab7f (stream MsgApp v2 writer)
2016-10-18 22:37:58.422715 I | rafthttp: stopped streaming with peer fa252746f913ab7f (writer)
2016-10-18 22:37:58.422761 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream Message reader)
2016-10-18 22:37:58.422785 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream MsgApp v2 reader)
2016-10-18 22:37:58.422807 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream MsgApp v2 reader)
2016-10-18 22:37:58.422851 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream MsgApp v2 reader)
2016-10-18 22:37:58.422862 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream Message reader)
2016-10-18 22:37:58.422974 I | rafthttp: closed the TCP streaming connection with peer fa252746f913ab7f (stream Message writer)
2016-10-18 22:37:58.422980 I | rafthttp: stopped streaming with peer fa252746f913ab7f (writer)
2016-10-18 22:37:58.422992 I | rafthttp: stopped HTTP pipelining with peer fa252746f913ab7f
2016-10-18 22:37:58.423034 W | rafthttp: lost the TCP streaming connection with peer fa252746f913ab7f (stream MsgApp v2 reader)
2016-10-18 22:37:58.423040 W | rafthttp: lost the TCP streaming connection with peer 8e9e05c52164694d (stream Message reader)
2016-10-18 22:37:58.423050 E | rafthttp: failed to read fa252746f913ab7f on stream MsgApp v2 (net/http: request canceled)
2016-10-18 22:37:58.423056 I | rafthttp: peer fa252746f913ab7f became inactive
2016-10-18 22:37:58.423063 I | rafthttp: stopped streaming with peer fa252746f913ab7f (stream MsgApp v2 reader)
2016-10-18 22:37:58.423104 W | rafthttp: lost the TCP streaming connection with peer fa252746f913ab7f (stream Message reader)
2016-10-18 22:37:58.423121 I | rafthttp: stopped streaming with peer fa252746f913ab7f (stream Message reader)
2016-10-18 22:37:58.423132 I | rafthttp: stopped peer fa252746f913ab7f
2016-10-18 22:37:58.428431 W | etcdserver: 8e9e05c52164694d failed to transfer leadership (etcdserver: unhealthy cluster)
2016-10-18 22:37:58.428533 I | cluster: stopped node1
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x9764d3]

goroutine 681697 [running]:
panic(0xc69520, 0xc42000c170)
    /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc/backend.(*batchTx).commit(0xc420205600, 0xdf5c00)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc/backend/batch_tx.go:165 +0x413
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc/backend.(*batchTx).Commit(0xc420205600)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc/backend/batch_tx.go:140 +0x66
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc/backend.(*backend).ForceCommit(0xc42016a720)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc/backend/backend.go:132 +0x2f
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc.(*store).Hash(0xc42023fa00, 0x0, 0x0, 0x0, 0x0)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/mvcc/kvstore.go:328 +0xa1
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc.(*maintenanceServer).Hash(0xc4219962a0, 0x11b93c0, 0xc433e2ab10, 0x1204ba8, 0x19e89fdb, 0xc42b730910, 0x48cb02)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/maintenance.go:117 +0x4c
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb._Maintenance_Hash_Handler.func1(0x11b93c0, 0xc433e2ab10, 0xce9a20, 0x1204ba8, 0x11bc520, 0xc42b01dc00, 0xc42b730988, 0x722778)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go:3056 +0xa2
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc.metricsUnaryInterceptor(0x11b93c0, 0xc433e2ab10, 0xce9a20, 0x1204ba8, 0xc4257a1520, 0xc4257a1540, 0x410e58, 0x20, 0xc978e0, 0x1)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/interceptor.go:100 +0x186
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc.newUnaryInterceptor.func1(0x11b93c0, 0xc433e2ab10, 0xce9a20, 0x1204ba8, 0xc4257a1520, 0xc4257a1540, 0x72e941, 0xc42b730b38, 0xc42b730b48, 0xc42b730b28)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/interceptor.go:56 +0xc3
github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb._Maintenance_Hash_Handler(0xcaeaa0, 0xc4219962a0, 0x11b93c0, 0xc433e2ab10, 0xc420243360, 0xc422f7ecc0, 0x0, 0x0, 0x12, 0xe)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go:3058 +0x166
github.com/coreos/etcdlabs/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc42374e000, 0x11bc700, 0xc42385d680, 0xc425786d20, 0xc422fa15f0, 0x11da028, 0xc433e2aae0, 0x0, 0x0)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/google.golang.org/grpc/server.go:611 +0xc14
github.com/coreos/etcdlabs/vendor/google.golang.org/grpc.(*Server).handleStream(0xc42374e000, 0x11bc700, 0xc42385d680, 0xc425786d20, 0xc433e2aae0)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/google.golang.org/grpc/server.go:769 +0x6b0
github.com/coreos/etcdlabs/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc420264810, 0xc42374e000, 0x11bc700, 0xc42385d680, 0xc425786d20)
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/google.golang.org/grpc/server.go:422 +0xab
created by github.com/coreos/etcdlabs/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
    /home/gyuho/go/src/github.com/coreos/etcdlabs/vendor/google.golang.org/grpc/server.go:423 +0xa3

from etcdlabs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.