diff --git a/weed/sequence/snowflake_sequencer.go b/weed/sequence/snowflake_sequencer.go index d6479fc68..679588120 100644 --- a/weed/sequence/snowflake_sequencer.go +++ b/weed/sequence/snowflake_sequencer.go @@ -5,6 +5,7 @@ import ( "hash/fnv" "github.com/bwmarrin/snowflake" + "github.com/chrislusf/seaweedfs/weed/glog" ) // a simple snowflake Sequencer @@ -13,7 +14,9 @@ type SnowflakeSequencer struct { } func NewSnowflakeSequencer(nodeid string) (*SnowflakeSequencer, error) { - node, err := snowflake.NewNode(int64(hash(nodeid) & 0x3ff)) + nodeid_hash := hash(nodeid) & 0x3ff + glog.V(0).Infof("use snowfalke seq id generator, nodeid:%s hex_of_nodeid: %x", nodeid, nodeid_hash) + node, err := snowflake.NewNode(int64(nodeid_hash)) if err != nil { fmt.Println(err) return nil, err diff --git a/weed/server/master_server.go b/weed/server/master_server.go index f5bad53fa..e2b2df18d 100644 --- a/weed/server/master_server.go +++ b/weed/server/master_server.go @@ -279,7 +279,6 @@ func (ms *MasterServer) createSequencer(option *MasterOption) sequence.Sequencer } case "snowflake": var err error - glog.V(0).Infof("use a snowfalke seq id, nodeid %s:%d", option.Host, option.Port) seq, err = sequence.NewSnowflakeSequencer(fmt.Sprintf("%s:%d", option.Host, option.Port)) if err != nil { glog.Error(err)