-- M10.8c incoming probe transfers (ADR-0096). A destination region shows a probe that is -- being handed to it as a read-only ghost before the switch; there is no region-to-region -- channel, so it reads the open transfers addressed to it. Read-only, under the caller's -- exact unexpired region lease like every runtime function. At most 256 rows, oldest first. CREATE FUNCTION evolution.incoming_probe_transfers(p_world evolution.u64, p_region evolution.u64, p_holder uuid, p_epoch evolution.u64) RETURNS TABLE (transfer_id uuid, account_id uuid, source_region evolution.u64, x bigint, y bigint, z bigint) LANGUAGE plpgsql SECURITY DEFINER SET search_path = pg_catalog, pg_temp AS $$ BEGIN PERFORM evolution.check_region_lease(p_world, p_region, p_holder, p_epoch); RETURN QUERY SELECT t.transfer_id, t.account_id, t.source_region, t.x, t.y, t.z FROM evolution.probe_transfers t WHERE t.world_id = p_world AND t.destination_region = p_region AND t.state IN ('prepared', 'staged') ORDER BY t.prepared_at, t.transfer_id LIMIT 256; END $$; REVOKE ALL ON FUNCTION evolution.incoming_probe_transfers(evolution.u64, evolution.u64, uuid, evolution.u64) FROM PUBLIC; GRANT EXECUTE ON FUNCTION evolution.incoming_probe_transfers(evolution.u64, evolution.u64, uuid, evolution.u64) TO :"runtime_role"; INSERT INTO evolution.schema_migrations(version, sha256) VALUES (13, :'migration_sha_13');