{"id":"IL-0527","org":"OpenStreetMap Foundation","date":"2025-06-25","docs":["https://github.com/openstreetmap/osmdbt/blob/master/man/osmdbt.md#recovery-procedure","https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4909b38af0","https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d87d07b7ad3b782cb74566cd771ecdb2823adf6a"],"title":{"en":"OpenStreetMap.org made no replication diffs for 16 hours as PostgreSQL logical decoding failed on a memory alloc error","ko":"OpenStreetMap.org 의 복제 diff 생성이 invalid memory alloc request size 오류로 16시간 멈춤"},"domain":["database"],"impact":{"scope":"No OpenStreetMap.org replication diffs for about 16 hours, so tile.openstreetmap.org, Nominatim, Overpass and third-party services could not stay up to date with map edits; the website and mapping API were read-only for about 25 minutes during the fix","users":"unknown","region":"unknown"},"review":{"written_by":"session","reviewed_at":null,"reviewed_by":null},"lessons":{"en":"Communication with the osmdbt developer was crucial for working out the workaround, and the operations team's understanding of osmdbt was limited.","ko":"osmdbt 개발자와의 소통이 우회 계획을 세우는 데 결정적이었다. 운영 팀은 osmdbt 를 충분히 이해하지 못하고 있었다."},"related":[],"sources":[{"url":"https://operations.osmfoundation.org/2025/07/11/post-mortem.html","kind":"blog","archived":"https://web.archive.org/web/20260928003218/https://operations.osmfoundation.org/2025/07/11/post-mortem.html"}],"summary":{"en":"OpenStreetMap.org publishes minutely, hourly and daily replication diffs that its own services and third parties use to stay up to date with map edits. osmdbt builds them from a PostgreSQL logical replication slot: osmdbt-get-log reads the changes into log data and osmdbt-create-diff writes the diff. PostgreSQL had been upgraded to 15.13-1.pgdg22.04+1 on 30 May 2025. From 21:33 UTC on 25 June the query osmdbt-get-log runs failed every time with ERROR: invalid memory alloc request size 1243650064, and no diffs were produced. The operations team names an unidentified condition in PostgreSQL replication as the cause and considers it possible that recent changes in PostgreSQL 15.13 caused or influenced it.\n\nAlertmanager alerted at 21:40 UTC, but no pager or SMS alert went out, and the team responded early on 26 June. Running osmdbt with fewer changesets per diff produced five diffs before failing again. An operations engineer raised the problem with the osmdbt developer on IRC at 06:49 UTC, and together they worked out a workaround that uses fakelog, an osmdbt component, to skip ahead of the replication condition. Edits had to be suppressed while fakelog was used, so after confirming that the weekly PostgreSQL backup had finished, the team put OpenStreetMap.org into a read-only maintenance window at 12:56 UTC. The manual fakelog runs produced diffs 006/658/640 to 006/658/673 between 13:13 and 13:17 UTC, the osmdbt timer was restarted at 13:21 UTC, and the read-only window ended at 13:22 UTC after about 25 minutes, about 16 hours after the first failure.","ko":"OpenStreetMap.org 의 복제 diff 는 다른 OpenStreetMap.org 서비스와 제3자 서비스가 지도 편집을 따라가는 데 쓰는 파일이다. 2025년 6월 25일 21:33 UTC 부터 6월 26일 13:22 UTC 까지 약 16시간 동안 diff 생성 시스템이 멈춰 minutely, hourly, daily diff 가 자동으로 만들어지지 않았다. osmdbt-get-log 가 osmdbt-create-diff 에 필요한 로그 데이터를 만들 때 쓰는 SQL 질의가 \"ERROR: invalid memory alloc request size 1243650064\" 로 계속 실패했다. 원인은 PostgreSQL 복제에 생긴 어떤 상태였고, 그 상태가 무엇인지는 밝혀지지 않았다. 5월 30일에 PostgreSQL 을 15.13-1.pgdg22.04+1 로 올렸고, 15.13 의 최근 변경이 이 오류를 일으켰거나 영향을 주었을 수 있다고 밝혔다.\n\nAlertmanager 가 21:40 UTC 부터 여러 번 알림을 보냈지만 호출기나 SMS 알림은 울리지 않았고, 운영 팀은 6월 26일 이른 아침에 대응을 시작했다. 복제 diff 하나에 담는 변경 묶음 수를 줄여 보았지만 해결되지 않았다. 운영 팀은 IRC 에서 osmdbt 개발자와 원인을 논의했고, osmdbt 의 구성 요소인 fakelog 로 문제 구간을 건너뛰는 우회 방법을 정해 시험 실행을 했다. fakelog 를 손으로 쓰는 동안 편집을 막아야 해서 1시간짜리 읽기 전용 긴급 점검을 잡았고, 주간 PostgreSQL 백업이 이미 끝났음을 확인했다.\n\n12:56 UTC 에 OpenStreetMap.org 가 읽기 전용 점검에 들어갔다. 13:13:47 부터 13:17:04 UTC 까지 fakelog 로 osmdbt 를 손으로 돌려 replication/minute/006/658/640 부터 673 까지 만들었고, 13:21:10 UTC 에 osmdbt 타이머를 다시 켰다. 읽기 전용 점검은 약 25분 만인 13:22 UTC 에 끝났고, 13:41 UTC 에 Alertmanager 알림이 풀렸다. 같은 날 18:00 UTC 운영 팀 정기 통화에 osmdbt 개발자가 함께해 PostgreSQL 쪽 원인, osmdbt 사용성 개선, osmdbt 전용 PostgreSQL 플러그인을 내장 pgout 으로 바꾸는 방안을 논의했다."},"trigger":null,"severity":"unknown","symptoms":["replication-lag"],"timeline":{"detected_after":"7m","resolved_after":"15h 49m"},"date_kind":"incident","detection":{"en":"Alertmanager sent the first alert at 21:40 UTC, minutely replication feed delayed - 6m 2s, and several more followed, but none was a pager or SMS alert. A community report followed at 00:37 UTC and a social media report at 01:13 UTC.","ko":"Alertmanager 가 이 일과 관련된 알림을 여러 번 보냈고, 첫 알림은 21:40 UTC 의 \"minutely replication feed delayed - 6m 2s\" 였다. 호출기나 SMS 로 가는 알림은 울리지 않았다."},"components":["database-replication","database"],"root_cause":"software-bug","remediation":[{"text":{"en":"Stopped the osmdbt timer","ko":"6월 26일 06:08 UTC 에 osmdbt 타이머를 멈췄다."}},{"text":{"en":"Put OpenStreetMap.org into a read-only maintenance window to suppress edits","ko":"12:56 UTC 에 OpenStreetMap.org 를 읽기 전용 점검에 들여 지도 편집을 막았다."}},{"text":{"en":"Ran osmdbt by hand with fakelog to skip ahead of the PostgreSQL replication condition","ko":"osmdbt 의 fakelog 도구를 손으로 써서 실패를 일으킨 PostgreSQL 복제 상태를 건너뛰었고, 13:13:47 부터 13:17:04 UTC 까지 replication/minute/006/658/640 부터 673 까지 diff 를 만들었다."}},{"text":{"en":"Restarted the osmdbt timer for minutely diffs","ko":"13:21:10 UTC 에 osmdbt 타이머를 다시 켜 minutely diff 생성을 되살렸다."}},{"text":{"en":"Ended the read-only maintenance window","ko":"13:22 UTC 에 약 25분 동안의 읽기 전용 점검을 끝냈다."}}],"action_items":[{"text":{"en":"Upgrade PostgreSQL to 17.x","ko":"PostgreSQL 을 17.x 로 업그레이드한다."}},{"text":{"en":"Raise an issue with the PostgreSQL developers","ko":"PostgreSQL 개발자에게 이 문제를 이슈로 올린다."}}],"contributing":["paging-failed"],"recurrence_of":null,"symptoms_text":{"en":"At 21:40 UTC on 25 June 2025, Alertmanager alerted the OpenStreetMap operations team: minutely replication feed delayed - 6m 2s. Since 21:33 UTC every run of the osmdbt timer that produces the minutely replication diffs had failed with ERROR: invalid memory alloc request size 1243650064.\n\nThe error came from PostgreSQL, in the query that osmdbt-get-log runs on the logical replication slot \"osmdbt\": SELECT * FROM pg_logical_slot_peek_changes($1, NULL, NULL). No minutely, hourly or daily diffs were produced, so tile.openstreetmap.org, Nominatim, Overpass and third-party services stopped receiving map edits. None of the alerts was a pager or SMS alert; the first community report came at 00:37 UTC on 26 June and the first social media report at 01:13 UTC.\n\nAt 06:08 UTC on 26 June the operations team stopped the osmdbt timer and ran osmdbt by hand with a reduced maximum number of changesets. Five diffs succeeded, then the error returned, until even --max-changes=1 triggered it. The team and the osmdbt developer looked at whether a huge set of map changes, such as 15 million or more node changes, had overwhelmed the PostgreSQL internal replication logs that osmdbt reads.","ko":"2025년 6월 25일 21:33 UTC 부터 OpenStreetMap.org 의 minutely, hourly, daily 복제 diff 가 새로 만들어지지 않았다. 21:40 UTC 에 Alertmanager 가 운영 팀에 \"minutely replication feed delayed - 6m 2s\" 라는 첫 알림을 보냈다.\n\n매분 도는 osmdbt 타이머 작업은 21:33:00 부터 \"ERROR: invalid memory alloc request size 1243650064\" 를 내며 매번 실패했다. PostgreSQL 로그에는 슬롯 \"osmdbt\" 의 logical decoding 을 시작하고 \"SELECT * FROM pg_logical_slot_peek_changes($1, NULL, NULL);\" 를 실행한 뒤 21:33:25 GMT 에 같은 오류가 찍혔다.\n\n복제 diff 가 멈추자 tile.openstreetmap.org, Nominatim, Overpass 같은 하류 서비스와 제3자 서비스가 지도 편집을 따라가지 못했다. 6월 26일 00:37 UTC 에 커뮤니티 포럼에 새 데이터가 지도에서 조회되지도 렌더링되지도 않는다는 첫 신고가 올라왔고, 01:13 UTC 에 소셜 미디어에도 첫 신고가 나왔다.\n\n6월 26일 06:08 UTC 에 운영 팀은 osmdbt 타이머를 멈추고 한 번에 처리하는 변경 묶음 수를 줄여 osmdbt 를 손으로 돌렸다. replication/minute/006/658/635.osc.gz 부터 639 까지 다섯 개는 성공했지만 06:27 무렵 다시 같은 메모리 할당 오류가 났다. 운영 팀 엔지니어는 IRC 에서 --max-changes=1 로도 오류가 난다고 알렸고, pg_logical_slot_peek_changes 가 PostgreSQL 내부의 고정 한도에 걸린 것으로 보았다. 운영 팀은 osmdbt 개발자와 함께 1,500만 개가 넘는 노드 변경 같은 큰 편집이 osmdbt 가 쓰는 PostgreSQL 내부 복제 로그를 넘치게 했는지 조사했다."},"updated_at":"2026-11-14T12:34:17.025501Z","url":"https://benchlet.com/incidentlib/app/cases/IL-0527","org_slug":"openstreetmap-foundation"}