0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-15 14:31:11 +01:00

ircd:Ⓜ️:vm::fetch: Remove/reorg stale fetch related options.

This commit is contained in:
Jason Volk 2019-09-05 13:17:04 -07:00
parent 5fddfd5366
commit f67eafd078
6 changed files with 16 additions and 43 deletions

View file

@ -232,45 +232,16 @@ struct ircd::m::vm::opts
// Verify the origin signature
bool verify {true};
/// Performs a query during the fetch stage to check if the event's auth
/// exists locally. This query is required for any fetching to be
/// possible.
bool fetch_auth_check {true};
/// Whether to automatically fetch the auth events when they do not exist.
bool fetch_auth {true};
/// Waits for auth events to be processed before continuing. Without
/// waiting, if any auth events are missing fault::EVENT is thrown.
/// Note that fault::AUTH is only thrown for authentication failures
/// while fault::EVENT is when the data is missing.
bool fetch_auth_wait {true};
/// Performs a query during the fetch stage to check if the room's state
/// exists locally. This query is required for any fetching to be
/// possible.
bool fetch_state_check {true};
/// Whether to automatically fetch the room state when there is no state
/// or incomplete state for the room found on the this server.
bool fetch_state {true};
/// Waits for a condition where fault::STATE would not be thrown before
/// continuing with the eval.
bool fetch_state_wait {true};
/// Performs a query during the fetch stage to check if the referenced
/// prev_events exist locally. This query is required for any fetching
/// to be possible.
bool fetch_prev_check {true};
/// Dispatches a fetch operation when a prev_event does not exist locally.
bool fetch_prev {true};
/// Waits for prev_events have been acquired before continuing with this
/// evaluation.
bool fetch_prev_wait {false};
/// Throws fault::EVENT if *all* of the prev_events do not exist locally.
/// This is used to enforce that at least one path is traversable. This
/// test is conducted after waiting if fetch_prev and fetch_prev_wait.
@ -281,6 +252,10 @@ struct ircd::m::vm::opts
/// corollary conditions are similar to fetch_prev_any.
bool fetch_prev_all {false};
/// The limit on the number of events to backfill if any of the prev_events
/// are missing. -1 is auto / conf.
size_t fetch_prev_limit = -1;
/// Evaluators can set this value to optimize the creation of the database
/// transaction where the event will be stored. This value should be set
/// to the amount of space the event consumes; the JSON-serialized size is

View file

@ -12542,8 +12542,8 @@ console_cmd__fed__sync(opt &out, const string_view &line)
m::vm::opts vmopts;
vmopts.nothrows = -1;
vmopts.debuglog_accept = true;
vmopts.fetch_prev_check = false;
vmopts.fetch_state_check = false;
vmopts.fetch_prev = false;
vmopts.fetch_state = false;
char rembuf[256];
vmopts.node_id = string(rembuf, remote);
m::vm::eval eval
@ -12808,8 +12808,8 @@ console_cmd__fed__backfill(opt &out, const string_view &line)
vmopts.nothrows = -1;
vmopts.room_head = false;
vmopts.room_head_resolve = true;
vmopts.fetch_prev_check = false;
vmopts.fetch_state_check = false;
vmopts.fetch_prev = false;
vmopts.fetch_state = false;
char rembuf[256];
vmopts.node_id = string(rembuf, remote);
m::vm::eval eval

View file

@ -157,7 +157,6 @@ put__invite(client &client,
vmopts.node_id = request.origin;
// Synapse may 403 a fetch of the prev_event of the invite event.
vmopts.fetch_prev_check = false;
vmopts.fetch_prev = false;
// We don't want this eval throwing an exception because the response has

View file

@ -234,7 +234,6 @@ try
vmopts.node_id = request.origin;
// Synapse may 403 a fetch of the prev_event of the invite event.
vmopts.fetch_prev_check = false;
vmopts.fetch_prev = false;
// Don't throw an exception for a re-evaluation; this will just be a no-op

View file

@ -406,8 +406,8 @@ try
m::vm::opts vmopts;
vmopts.nothrows = -1;
vmopts.warnlog &= ~vm::fault::EXISTS;
vmopts.fetch_state_check = false;
vmopts.fetch_prev_check = false;
vmopts.fetch_state = false;
vmopts.fetch_prev = false;
vmopts.infolog_accept = false;
m::vm::eval
{
@ -446,8 +446,8 @@ try
m::vm::opts opts;
opts.nothrows = -1;
opts.warnlog &= ~vm::fault::EXISTS;
opts.fetch_prev_check = false;
opts.fetch_state_check = false;
opts.fetch_state = false;
opts.fetch_prev = false;
opts.infolog_accept = true;
m::vm::eval
{

View file

@ -93,10 +93,10 @@ try
m::room room{room_id};
room.event_id = event_id;
if(opts.fetch_auth_check)
if(opts.fetch_auth)
hook_handle_auth(event, eval, room);
if(opts.fetch_prev_check)
if(opts.fetch_prev)
hook_handle_prev(event, eval, room);
log::debug
@ -231,8 +231,8 @@ try
m::vm::opts vmopts;
vmopts.infolog_accept = true;
vmopts.fetch_prev_check = false;
vmopts.fetch_state_check = false;
vmopts.fetch_prev = false;
vmopts.fetch_state = false;
vmopts.warnlog &= ~vm::fault::EXISTS;
m::vm::eval
{