Re: ZEO as a kind of memcache
Jim Fulton <[email protected]> Tue, 8 Aug 2017 12:41:44 -0400
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <CAPDm-Fjhu-mWizeH2b8SnEi5cyQDstZ7RhmKgbLT41_4kY8_Mw@mail.gmail.com> |
On Tue, Aug 8, 2017 at 12:37 PM, Rafael Oliveira <[email protected]> wrote: > On Mon, Aug 7, 2017 at 6:22 PM, Jim Fulton <[email protected]> wrote: > >> >> It kind of works. I haven't tested it much yet. A problem I already found >>> is that when I restart the ZEO server the Zope instances complain with this >>> message: ClientStorageError: [('127.0.0.1', 3100)] Client has seen newer >>> transactions than server! >>> >> >> This is because the client has a replica of a database that doesn't exist >> anymore. >> >> If you truly want this to be memory only, I think you'd want to find a >> way to signal to the clients that they should all discard their caches. >> Or, as Sean suggested, store your results persistently. >> > > I thought the "drop-cache-rather-verify" option would do that, but it > didn't work as expected. > The problem is that when you restart the server, the storage tid is 0, so the server tid is < the client tid. You need to initialize the mapping storage, so it a) has a root object, and b) has a tid that's > the client tids. You can probably arrange this by subclassing MappingStorage. Ultimately, you might be better off writing a simpler storage. For example, you don't care about history, which MappingStorage preserves. Mapping storage was also meant to server as an example of implementing storages and has a fairly naive implementation. Jim -- Jim Fulton http://jimfulton.info -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.