Ticket #317 (new task)
Schema cache: Lily client using more up-to-date cache than server
| Reported by: | evert | Owned by: | evert |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2 |
| Component: | Repository | Version: | |
| Keywords: | Cc: |
Description
LilyClient? randomly connects to a Lily server. It could be that an update on a type through one server is not known yet by the cache of another server. An new update requiring this type (e.g. record type create using a just-created field type) could then result in a TypeNotFoundException?.
To avoid such situation it is recommended to use LilyClient#getPlainRepository?() when updating a bunch of types.
An alternative would be to use a HBase counter which is increased on each schema update. This counter is then included in the data in the bucket zookeeper nodes, and it is returned to the LilyClient? (not the end-user client) (or the LilyClient? deducts this from its own cache: To-be-investigated). When a schema cache performs a refresh it keeps the highest counter it has seen so far.
The LilyClient? can then send this counter along with an update request, stating that the cache that is being used on the server should at least be up-to-date to this counter.