- From: "John E. Vincent (lusis)" <
- Subject: [chef] Revisting an old idea
- Date: Sun, 30 Sep 2012 12:23:32 -0700
At some point several months back, I had a discussion with some folks.
Maybe it was at ChefConf. Regardless, we discussed the idea of a
"cached search". Opscoded added (or maybe it hasn't made it in yet),
the idea of partial search. My suggestion/idea was that the idea of a
cached search be added that was computed once at the beginning of the
run and saved globally for the whole run. The thought was that we
frequently perform the exact same search across different recipes. For
instance in ours we have this at the top of almost every recipe:
distributor = search(:node, "role:distributor AND
That's how we locate our current internal blob distribution point
(nginx serving a bunch of files for Chef in this case).
It would be pretty awesome if we only had to compute that once. I've
not tinkered with any specific implementation yet. Does the idea
interest anyone else? I was thinking either an additional parameter to
the existing search (':cached => true') or possibly a new LWRP (in the
same way I did encrypted databags before official support was there).
I've never looked at the guts of search but I'm pretty sure there are
some possible edge cases where search results would change mid-run
between recipes that could cause some nasty issue to crop up.
John E. Vincent
- [chef] Revisting an old idea, John E. Vincent (lusis), 09/30/2012
Archive powered by MHonArc 2.6.16.