<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Internals on PIG.CENTER</title><link>https://pig.center/docs/etcd/dev-internal/</link><description>Recent content in Internals on PIG.CENTER</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 08 Sep 2026 21:29:01 +0800</lastBuildDate><atom:link href="https://pig.center/docs/etcd/dev-internal/index.xml" rel="self" type="application/rss+xml"/><item><title>Discovery service protocol</title><link>https://pig.center/docs/etcd/dev-internal/discovery_protocol/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/etcd/dev-internal/discovery_protocol/</guid><description>&lt;p&gt;Discovery service protocol helps new etcd member to discover all other members in cluster bootstrap phase using a shared discovery token and endpoint list.&lt;/p&gt;&#10;&lt;p&gt;Discovery service protocol is &lt;em&gt;only&lt;/em&gt; used in cluster bootstrap phase, and cannot be used for runtime reconfiguration or cluster monitoring.&lt;/p&gt;&#10;&lt;p&gt;The protocol uses a new discovery token to bootstrap one &lt;em&gt;unique&lt;/em&gt; etcd cluster. Remember that one discovery token can represent only one etcd cluster. As long as discovery protocol on this token starts, even if it fails halfway, it must not be used to bootstrap another etcd cluster.&lt;/p&gt;</description></item><item><title>Logging conventions</title><link>https://pig.center/docs/etcd/dev-internal/logging/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/etcd/dev-internal/logging/</guid><description>&lt;p&gt;etcd uses the &lt;a href="https://github.com/uber-go/zap"&gt;zap&lt;/a&gt;&#10; library for logging application output categorized into &lt;em&gt;levels&lt;/em&gt;. A log message&amp;rsquo;s level is determined according to these conventions:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;DebugLevel logs are typically voluminous, and are usually disabled in production.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Examples:&#10;&lt;ul&gt;&#10;&lt;li&gt;Send a normal message to a remote peer&lt;/li&gt;&#10;&lt;li&gt;Write a log entry to disk&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;InfoLevel is the default logging priority.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Examples:&#10;&lt;ul&gt;&#10;&lt;li&gt;Startup configuration&lt;/li&gt;&#10;&lt;li&gt;Start to do snapshot&lt;/li&gt;&#10;&lt;li&gt;Add a new node into the cluster&lt;/li&gt;&#10;&lt;li&gt;Add a new user into auth subsystem&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;WarnLevel logs are more important than Info, but don&amp;rsquo;t need individual human review.&lt;/p&gt;</description></item><item><title>Golang modules</title><link>https://pig.center/docs/etcd/dev-internal/modules/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/etcd/dev-internal/modules/</guid><description>&lt;p&gt;The etcd project (since version 3.5) is organized into multiple&#10;&lt;a href="https://golang.org/ref/mod"&gt;golang modules&lt;/a&gt;&#10; hosted in a &lt;a href="https://golang.org/ref/mod#vcs-dir"&gt;single repository&lt;/a&gt;&#10;.&lt;/p&gt;&#10;&lt;img class="td-image" src="https://pig.center/docs/etcd/dev-internal/img/modules.svg" alt="modules graph" loading="lazy" decoding="async"&gt;&lt;p&gt;There are following modules:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;strong&gt;go.etcd.io/etcd/api/v3&lt;/strong&gt; - contains API definitions&#10;(like protos &amp;amp; proto-generated libraries) that defines communication protocol&#10;between etcd clients and server.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;strong&gt;go.etcd.io/etcd/pkg/v3&lt;/strong&gt; - collection of utility packages used by etcd&#10;without being specific to etcd itself. A package belongs here&#10;only if it could possibly be moved out into its own repository in the future.&#10;Please avoid adding here code that has a lot of dependencies on its own, as&#10;they automatically becoming dependencies of the client library&#10;(that we want to keep lightweight).&lt;/p&gt;</description></item></channel></rss>