Sure, that would be even better (but you didn't sound like supporting that idea a few days back). So having "state", "blame" and "keyvals" would work well, in my opinion.
Hm, I can't actually imagine any case where freeform text *strictly* for humans would get too useful. But I can imagine cases where the field is useful for humans *and* machines. As an example, we currently have several known causes why minions are not properly created. Linking to backingstores might fail, the libvirt VM creation or startup might fail, and we might time out while waiting for the machine. Those are 3 different reasons for the same overall problem in "MINION_CREATION". So, I imagine we can store it like this:
state: CRASHED
blame: TASKOTRON
keyvals:
step: MINION_CREATION
reason: TIMED_OUT
or like this:
state: CRASHED
blame: TASKOTRON
cause: MINION_CREATION
keyvals:
reason: TIMED_OUT
All of that is human readable and machine parseable. The top level keys are enums in the database, the keyvals are defined in libtaskotron and the database doesn't care. Of course, keyvals are keyvals, so we can easily add something like "human_description: foo" if we need it and use it for some use cases, or even "time_elapsed: 70" or whatever. It's keyvals, so we can easily ignore the ones we don't care about, and use them only in specific cases, or whatever. They are flexible and can be easily extended.
And now we finally get to the point. When Tim asks "do you know how often backing stores linking fails during minion creation?" (as he really did in T833), we can say "here's a simple query to find out!". Or, if it is not implemented yet, we can say "let's add new 'reason: BACKINGSTORE_LINKING' and let's see in a month!". Because currently we can't really say anything and the best thing to do is to grep all logs, or make some custom hack on our servers.
I understand it's just an example, but in this case it would be probably CRASHED->UNKNOWN->UNKNOWN, because if you don't know to cause, you can't blame anybody.
And here the blame would be THIRDPARTY, since it's NETWORK :-)
I'd prefer keyvals over this, because you can't fit anything useful for querying to the free-form details field (or, as you said, you'd rather avoid that). The fact that I know it crashed because of network might not be enough information to debug issues, decide rescheduling, etc.
You probably meant 'than', right? I'm a bit confused here.
Do the example with keyvals I posted above look better? I'd say using the keyvals with known enum values (defined in libtaskotron) is definitely more realiable and maintainable than matching free-form text like above.
Right. But the logic whether to reschedule has to be somewhere. If it lives somewhere around trigger, we need to expose enough information to help it decide. Because "cause: MINION_CREATION" or "cause: NETWORK" might not mean we want to reschedule _always_ (I don't have any concrete use cases now). So exposing more details in "step" and "reason" (or whatever) keyvals might be used to help with that decision (and of course, they serve also other purposes on top of that, like debugging).
The second approach is to put the logic into libtaskotron, and if it decides the task should be rescheduled, it can set "reschedule: TRUE/FALSE" value (as a database column, or a keyval). That looks very nice from database POV, but I'm not sure that libtaskotron is a good place to put this logic in.
_______________________________________________
qa-devel mailing list -- qa-devel@lists.fedoraproject.org
To unsubscribe send an email to qa-devel-leave@lists.fedoraproject.org