Closed rdaum closed 9 months ago
This work is basically:
WorldState
trait a function to query quota per object owner.WorldState
for the size of a specific object.values
so that Var
and VerbDef
etc have reasonably efficient "tell me your size in bytes" functions.rocksdb
backend. Would mean tracking byte sizes for all the different column families that bits of objects are stored in, since an object is never stored as a whole chunk.create
and recycle
bf_values.rs
to use the stuff from 3.LambdaMOO's quota implementation, by the way, is almost entirely done in-database, only relying on an object_size
builtin. The quota-handling code in built-in create
and recycle
is a relic of way back when when object quota rather than byte quota was used.
And you could even not do that and reactivate $quota_utils:object_bytes(old) and LambdaMOO's quota system would almost just work.
Thanks, I keep meaning to dig into it in earnest, but part of the problem is I really don't like the way the bytes quota stuff ends up putting some annoying requirements into the DB layer that are rather awkward to implement. Knowing how many bytes an object uses up is a bit tricky in the context of systems built with paged datastructures and the like where the packing of a given page depends on branching factors and etc and what not, and in my current DB impl all the pieces that make up what an object is are scattered across multiple "column families" etc. I'd prefer to avoid having to scan all of them to go look it up for a given object, so I will probably have to add specific summary tables, cache them etc.
So yeah, as per @pppery's comment, I'm hoping/assuming I do not need to implement the "old school" create
/recycle
object-count based quota at all, and as I have a working object_bytes
now, I think that's all that's needed.
I haven't done any rigorous testing with a core, but if anything comes up I'll re-open this ticket. For now I'll consider this done.
Remaining related work is implementing db_disk_size
in some form, but that's not about quota, really.
Requires at least estimating object sizes and tracking them per user / owner. Need some hooks on the
WorldState
interface.