You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "rnewson (via GitHub)" <gi...@apache.org> on 2025/05/01 15:09:23 UTC
[I] interactive_database_writes_threshold blocks writing on internal checkpoints [couchdb]
rnewson opened a new issue, #5528:
URL: https://github.com/apache/couchdb/issues/5528
## Description
when interactive_database_writes_threshold is exceeded, we deliberately allow mem3_rep to continue internal sync (indeed all replicated change requests are permitted). unfortunately mem3_rep will eventually crash when it tries to write its checkpoint as this is a normal doc edit. Exempt these writes from the blocking behaviour.
...with exit value:#012{{nocatch,{insufficient_storage,<<"database_dir is too full">>}},[{couch_db,update_doc,4,[{file,"src/couch_db.erl"},{line,876}]},{mem3_rep,update_locals,3,[{file,"src/mem3_rep.erl"},{line,740}]},{mem3_rep,replicate_batch,4,[{file,"src/mem3_rep.erl"},{line,641}]},{maps,map_1,3,[{file,"maps.erl"},{line,441}]},{maps,map,2,[{file,"maps.erl"},{line,426}]},{mem3_rep,replicate_batch_multi,1,[{file,"src/mem3_rep.erl"},{line,619}]},{mem3_rep,'-push_changes/1-fun-0-',3,[{file,"src/mem3_rep.erl"},{line,550}]},{mem3_rep,with_src_db,2,[{file,"src/mem3_rep.erl"},{line,840}]}]}#012
## Steps to Reproduce
enable disk_monitor, add lots of data then promptly set interactive_database_writes_threshold to lower than current disk usage. with luck internal sync is behind and will then fail to catch up when it tries to checkpoint.
## Expected Behaviour
internal replication should proceed regardless of interactive_database_writes_threshold setting, at least until the end of disk itself is reached.
## Your Environment
N/A
## Additional Context
[TIP]: # ( Add any other context about the problem here. )
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] interactive_database_writes_threshold blocks writing of internal checkpoints [couchdb]
Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on issue #5528:
URL: https://github.com/apache/couchdb/issues/5528#issuecomment-2845047450
`_diff --git i/src/couch/src/couch_db.erl w/src/couch/src/couch_db.erl
index 8718b5b82..bae68aef0 100644
--- i/src/couch/src/couch_db.erl
+++ w/src/couch/src/couch_db.erl
@@ -1348,9 +1348,10 @@ update_docs(Db, Docs0, Options, ?REPLICATED_CHANGES) ->
),
{ok, DocErrors};
update_docs(Db, Docs0, Options, ?INTERACTIVE_EDIT) ->
+ OverrideWriteBlock = lists:member(override_write_block, Options),
BlockInteractiveDatabaseWrites = couch_disk_monitor:block_interactive_database_writes(),
if
- BlockInteractiveDatabaseWrites ->
+ not OverrideWriteBlock andalso BlockInteractiveDatabaseWrites ->
{ok, [{insufficient_storage, <<"database_dir is too full">>} || _ <- Docs0]};
true ->
update_docs_interactive(Db, Docs0, Options)
diff --git i/src/mem3/src/mem3_rep.erl w/src/mem3/src/mem3_rep.erl
index 3df07a9fd..4c28956b5 100644
--- i/src/mem3/src/mem3_rep.erl
+++ w/src/mem3/src/mem3_rep.erl
@@ -737,7 +737,7 @@ update_locals(Target, Db, Seq) ->
{<<"timestamp">>, list_to_binary(mem3_util:iso8601_timestamp())}
],
NewBody = mem3_rpc:save_checkpoint(Node, Name, Id, Seq, NewEntry, History),
- {ok, _} = couch_db:update_doc(Db, #doc{id = Id, body = NewBody}, []).
+ {ok, _} = couch_db:update_doc(Db, #doc{id = Id, body = NewBody}, [override_write_block]).
purge_cp_body(#shard{} = Source, #shard{} = Target, PurgeSeq) ->
{Mega, Secs, _} = os:timestamp(),_`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] interactive_database_writes_threshold blocks writing of internal checkpoints [couchdb]
Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson closed issue #5528: interactive_database_writes_threshold blocks writing of internal checkpoints
URL: https://github.com/apache/couchdb/issues/5528
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org