You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Automatically retry writes on the gateway #379
Purpose of the feature.
Have gateway hold writes when it sees the backing DB has been shut down. The kubernetes operator needs to have this for seamless failovers when promoting/demoting postgres
Describe the solution you'd like
When the gateway receives a write request and sees that the PG database is down, instead of returning failure, retry that request for ~2 minutes.
Describe alternatives you've considered
The alternative would be to adjust the client to handle these exceptions.
Additional context
This feature is only relevant in the scenario where the gateway is running, but the PG instance is not.
👋 @AndrewKhoma — this issue has been assigned for 64 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @AndrewKhoma — this issue has been assigned for 15 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
Verified against an isolated ghcr.io/documentdb/documentdb/documentdb-local:pg17-0.114.0 instance: this is not fixed.
Repro:
Confirmed a baseline insertOne succeeds through the gateway.
Kept the gateway running and stopped its PostgreSQL process with pg_ctl -D /data -m immediate -w stop.
Submitted db.items.insertOne({_id: 2, stage: "retried-after-postgres-restart"}) through the gateway while PostgreSQL was unavailable.
Restarted PostgreSQL after 12 seconds with pg_ctl -D /data -o "-p 9712" -w start.
Actual result: the write immediately returned MongoServerError: An unexpected internal error and was not persisted. Gateway logs show Request failed with kind Pool, code InternalError and error connecting to server; no request retry occurred.
The requested behavior is to hold/retry writes while PostgreSQL is down, so removing the release milestone and merged label.
👋 @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 19 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
Activity
AndrewKhoma commentedon Nov 18, 2025
thanks for reporting this!
AndrewKhoma commentedon Mar 26, 2026
@alaye-ms #541 contained these changes, please, verify from your end
documentdb-triage-tool commentedon May 30, 2026
👋 @AndrewKhoma — this issue has been assigned for 64 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Jun 13, 2026
👋 @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Jun 28, 2026
👋 @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Jul 13, 2026
👋 @AndrewKhoma — this issue has been assigned for 15 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
xgerman commentedon Jul 24, 2026
Verified against an isolated
ghcr.io/documentdb/documentdb/documentdb-local:pg17-0.114.0instance: this is not fixed.Repro:
insertOnesucceeds through the gateway.pg_ctl -D /data -m immediate -w stop.db.items.insertOne({_id: 2, stage: "retried-after-postgres-restart"})through the gateway while PostgreSQL was unavailable.pg_ctl -D /data -o "-p 9712" -w start.Actual result: the write immediately returned
MongoServerError: An unexpected internal errorand was not persisted. Gateway logs showRequest failed with kind Pool, code InternalErroranderror connecting to server; no request retry occurred.The requested behavior is to hold/retry writes while PostgreSQL is down, so removing the release milestone and
mergedlabel.documentdb-triage-tool commentedon Aug 8, 2026
👋 @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
tsharp commentedon Aug 13, 2026
@xgerman - do you know what the time between the write failure and the backend coming back up was?
documentdb-triage-tool commentedon Aug 27, 2026
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Sep 11, 2026
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Sep 25, 2026
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Oct 9, 2026
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Oct 28, 2026
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 19 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.
documentdb-triage-tool commentedon Nov 11, 2026
👋 @tsharp, @AndrewKhoma — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.