# primary

Published articles for primary.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Detecting Replica Lag That Breaks Read-Your-Writes Consistency

DevFeed: [Detecting Replica Lag That Breaks Read-Your-Writes Consistency](<https://devfeed.tech/articles/the-replica-lag-you-do-not-measure-is-the-one-serving-checkout-39596.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/44-replica-lag-read-your-writes/>)

Author: hello@ankit-rana.com

Published: 2026-08-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Replication](<https://devfeed.tech/topics/replication.md>), [Routing (disambiguation)](<https://devfeed.tech/topics/routing.md>)

Tags: [checkout](<https://devfeed.tech/tags/checkout.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [lag](<https://devfeed.tech/tags/lag.md>), [metric](<https://devfeed.tech/tags/metric.md>), [observability](<https://devfeed.tech/tags/observability.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [primary](<https://devfeed.tech/tags/primary.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [read-replicas](<https://devfeed.tech/tags/read-replicas.md>), [replica-lag](<https://devfeed.tech/tags/replica-lag.md>), [replication](<https://devfeed.tech/tags/replication.md>), [routing](<https://devfeed.tech/tags/routing.md>)

### AI overview

This article explains how read replicas can break read-your-writes behavior when applications do not route related reads to the primary or wait for replication. It compares byte lag with time lag, explains why idle systems can hide failures, and discusses replay delays caused by write bursts and long-running replica queries.

### Source excerpt

Byte lag between primary and replica reads zero on an idle primary even when replication is completely stuck, so the metric that looks healthiest is the one that hides the failure. Time lag measured from the last replayed transaction is the signal that stays honest. Adding a read replica silently removes read-your-writes, which means any flow that writes and then reads back needs either primary routing or an explicit wait for the replica to reach that write's log position.

## 【etcd】Lease 与 KeepAlive：TTL、checkpoint 与 Leader 切换

DevFeed: [【etcd】Lease 与 KeepAlive：TTL、checkpoint 与 Leader 切换](<https://devfeed.tech/articles/etcd-lease-keepalive-ttl-checkpoint-leader-33992.md>)

Original publisher: [Read original article](<https://quant67.com/post/etcd/10-lease/10-lease.html>)

Author: Liao Tonglang

Published: 2026-08-26T00:00:00Z

Content type: tutorial

Language: zh

Sources: [土法炼钢 - 系统与基础设施](<https://devfeed.tech/sources/source-4.md>)

Topics: [etcd](<https://devfeed.tech/topics/etcd.md>), [Raft](<https://devfeed.tech/topics/raft.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [Remote Procedure Call (RPC)](<https://devfeed.tech/topics/rpc.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [checkpoint](<https://devfeed.tech/tags/checkpoint.md>), [client](<https://devfeed.tech/tags/client.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [distributed](<https://devfeed.tech/tags/distributed.md>), [etcd](<https://devfeed.tech/tags/etcd.md>), [follower](<https://devfeed.tech/tags/follower.md>), [k8s](<https://devfeed.tech/tags/k8s.md>), [keepalive](<https://devfeed.tech/tags/keepalive.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [lease](<https://devfeed.tech/tags/lease.md>), [lessor](<https://devfeed.tech/tags/lessor.md>), [primary](<https://devfeed.tech/tags/primary.md>), [raft](<https://devfeed.tech/tags/raft.md>), [ttl](<https://devfeed.tech/tags/ttl.md>), [v3](<https://devfeed.tech/tags/v3.md>), [v3-5-33](<https://devfeed.tech/tags/v3-5-33.md>), [watch](<https://devfeed.tech/tags/watch.md>)

### AI overview

This article explains etcd v3.5.33 lease behavior, focusing on the lessor's primary, demote, and promote roles, the KeepAlive renewal path that normally bypasses Raft, lease checkpointing, and TTL changes during leader transitions. It also discusses implications for Kubernetes Node Leases and distributed locks.

### Source excerpt

钉 etcd v3.5.33 lessor 的 primary/demote/promote、KeepAlive 不经 Raft 的 Renew 路径、LeaseCheckpoint 与 Promote 时 TTL 展期，以及 Leader 切换对 Node Lease 的排障落格。

## Waiting for PostgreSQL 19 - psql: Add %i prompt escape to indicate hot standby status.

DevFeed: [Waiting for PostgreSQL 19 - psql: Add %i prompt escape to indicate hot standby status.](<https://devfeed.tech/articles/waiting-for-postgresql-19-psql-add-i-prompt-escape-to-indicate-hot-standby-status-33678.md>)

Original publisher: [Read original article](<https://www.depesz.com/2026/02/21/waiting-for-postgresql-19-psql-add-i-prompt-escape-to-indicate-hot-standby-status/>)

Author: depesz

Published: 2026-02-21T14:51:47Z

Content type: article

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Replication](<https://devfeed.tech/topics/replication.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [commit](<https://devfeed.tech/tags/commit.md>), [pg19](<https://devfeed.tech/tags/pg19.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [primary](<https://devfeed.tech/tags/primary.md>), [psql](<https://devfeed.tech/tags/psql.md>), [replication](<https://devfeed.tech/tags/replication.md>), [standby](<https://devfeed.tech/tags/standby.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [waiting](<https://devfeed.tech/tags/waiting.md>)

### AI overview

The article explains a PostgreSQL 19 patch that adds the %i prompt escape to psql. The escape indicates whether the connected server is a primary or operating in hot standby mode, making replication status visible in the psql prompt.

### Source excerpt

On 3rd of February 2026, Fujii Masao committed patch: psql: Add %i prompt escape to indicate hot standby status. This commit introduces a new prompt escape %i for psql, which shows whether the connected server is operating in hot standby mode. It expands to standby if the server reports in_hot_standby = on, and primary ... Continue reading "Waiting for PostgreSQL 19 - psql: Add %i prompt escape to indicate hot standby status."

## Postgres HA: roles are dynamic

DevFeed: [Postgres HA: roles are dynamic](<https://devfeed.tech/articles/postgres-ha-roles-are-dynamic-34616.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2021/12/postgres-ha-roles-are-dynamic/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2021-12-14T21:36:36Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [rdbms](<https://devfeed.tech/topics/rdbms.md>), [Availability](<https://devfeed.tech/topics/availability.md>), [Resilience](<https://devfeed.tech/topics/resilience.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [configuration](<https://devfeed.tech/tags/configuration.md>), [failover](<https://devfeed.tech/tags/failover.md>), [high-availability](<https://devfeed.tech/tags/high-availability.md>), [independent](<https://devfeed.tech/tags/independent.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [primary](<https://devfeed.tech/tags/primary.md>), [rdbms](<https://devfeed.tech/tags/rdbms.md>), [resilience](<https://devfeed.tech/tags/resilience.md>), [server](<https://devfeed.tech/tags/server.md>), [standby](<https://devfeed.tech/tags/standby.md>)

### AI overview

This article explains why PostgreSQL high-availability systems require dynamic node roles. Failover can promote a standby node to primary, so a node's current role should not be treated as a fixed architectural property. The article also discusses how PostgreSQL configuration and instance initialization affect role changes, and why separate failover-management software is needed.

### Source excerpt

High-Availability comes with some impact on your architecture choices, in particular when applied to RDBMS such as Postgres. One such impact is the idea of a failover. When implementing database HA, it is usually expected that both the service and the data are maintained available in the face of operational faults. The most common way to implement resilience includes automated (or manual) failover, where a new primary is elected among a list of standby nodes. In other words, as soon as Postgres High-Availability is implemented, the roles of your Postgres nodes are dynamic. The fact that a given node is a primary or a standby at any given point in time ceases to be relevant to understanding your architecture. In fact, the only thing that's now given about the role of a node is that it will change. Otherwise you don't have failover capability, and then, you probably don't have HA in the first place, right? In this article we are going to try and understand what having dynamic roles for Postgres nodes in a HA system means.

## 分布式文件系统的演化

DevFeed: [分布式文件系统的演化](<https://devfeed.tech/articles/article-40973.md>)

Original publisher: [Read original article](<https://blog.joway.io/posts/deep-into-distributed-filesystem/>)

Author: Joway

Published: 2020-06-14T00:00:00Z

Content type: tutorial

Language: zh

Sources: [Random Thoughts](<https://devfeed.tech/sources/random-thoughts.md>)

Topics: [IO](<https://devfeed.tech/topics/io.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [Ext4](<https://devfeed.tech/topics/ext4.md>), [hdfs](<https://devfeed.tech/topics/hdfs.md>), [Google](<https://devfeed.tech/topics/google.md>)

Tags: [blocks](<https://devfeed.tech/tags/blocks.md>), [client](<https://devfeed.tech/tags/client.md>), [ext4](<https://devfeed.tech/tags/ext4.md>), [filesystem](<https://devfeed.tech/tags/filesystem.md>), [google](<https://devfeed.tech/tags/google.md>), [hdfs](<https://devfeed.tech/tags/hdfs.md>), [io](<https://devfeed.tech/tags/io.md>), [lease](<https://devfeed.tech/tags/lease.md>), [linux](<https://devfeed.tech/tags/linux.md>), [master](<https://devfeed.tech/tags/master.md>), [pointers](<https://devfeed.tech/tags/pointers.md>), [primary](<https://devfeed.tech/tags/primary.md>), [ssd](<https://devfeed.tech/tags/ssd.md>), [tech](<https://devfeed.tech/tags/tech.md>)

### AI overview

This article explains local filesystem structure, including superblocks, inodes, block pointers, and file-size limits, then introduces the evolution and architecture of distributed filesystems. It uses GFS to describe metadata lookup, chunk locations, caching, replication, leases, and client read and write flows, and mentions HDFS as a related implementation.

### Source excerpt

文件系统是操作系统 IO 栈里非常重要的一个中间层，其存在的意义是为了让上层应用程序有一层更加符合人类直觉的抽象来进行文档的读写，而无需考虑底层存储上的细节。 本地文件系统 在讨论分布式文件系统前，我们先来回顾下本地文件系统的组成。 存储结构 在前面一张图里，我们能够看到文件系统直接和通用块层进行交互，无论底层存储介质是磁盘还是 SSD，都被该层抽象为 Block 的概念。文件系统在初始化时，会先在挂载的块存储上的第一个位置创建一个 Super Block：

## PostgreSQL High Availability with Primary and Standby Servers

DevFeed: [PostgreSQL High Availability with Primary and Standby Servers](<https://devfeed.tech/articles/queen-princesses-and-workers-34574.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2017/12/queen-princesses-and-workers/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2017-12-11T09:19:24Z

Content type: article

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Availability](<https://devfeed.tech/topics/availability.md>), [postgresql clusters](<https://devfeed.tech/topics/postgresql-clusters.md>), [Database](<https://devfeed.tech/topics/database.md>), [Load Balancing](<https://devfeed.tech/topics/load-balancing.md>)

Tags: [availability](<https://devfeed.tech/tags/availability.md>), [high-availability](<https://devfeed.tech/tags/high-availability.md>), [load-balancing](<https://devfeed.tech/tags/load-balancing.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [primary](<https://devfeed.tech/tags/primary.md>), [replication](<https://devfeed.tech/tags/replication.md>), [standby](<https://devfeed.tech/tags/standby.md>)

### AI overview

This article explains PostgreSQL high-availability architectures using primary and standby servers. It discusses replication, online backups, automated recovery, and promoting a standby server when the primary becomes unavailable.

### Source excerpt

The PostgreSQL community made the explicit choice some times ago that they would not use the infamous master and slave terminology. Instead, the documentation introduces the concepts of High Availability, Load Balancing, and Replication with the terms Primary and Standby, and the even more generic term Replica is used in contexts when only the data flow is considered, rather than the particular role of a node.