Fetching Uids derived from a base type?

27 views
Skip to first unread message

Manuel Finelli

unread,
Jul 22, 2022, 9:39:25 AM7/22/22
to narayana-users
A bit of context first

Since this conversation in our Zulip, I have been developing the new recovery login in Narayana’s RecoveryManagerImpl (which recovers in-flight/in-doubt transactions before terminating the recovery manager). It turns out that the hardest bit of this development is to find out if there are transactions left in the Object Store. In a first attempt to tackle this problem, I used the `ObjStoreBrowser` in our package `com.arjuna.ats.arjuna.tools.osb.mbean`. Although `ObjStoreBrowser` worked like a charm, employing this Object Store browser is an overkill as this browser produces MBeans while navigating the Object Store. As an alternative, I developed a wrapper of `ObjectStoreIterator` to check if a particular type has transactions associated with it.

Here where the question comes

To fetch transactions from the Object Store, I need to know (in advance) what types I want to skim through. Although this could be achieved by adding (another) configuration property in the RecoveryEnvironmentBean (or wherever it is more appropriate), I was hoping to find a better/more elegant way to express what kind of types I am interested in (or, at the very least, shorten the list of types I have to specify in the new property). To achieve this, I thought that it might be worth to add an extra two methods to the RecoveryStore interface:
  • boolean allObjUidsDerivedFrom (String s, InputObjectState buff, int m)
  • boolean allObjUidsDerivedFrom (String s, InputObjectState buff)
These two methods would fetch all transactions that are derived from a specific base class. For now, these methods would be employed only in the new logic to stop the recovery manager but I think that (in general) they might be useful methods to have in our ObjectStoreAPI and they might simplify other parts of Narayana (e.g. ObjStoreBrowser). What do you think about this?

Many thanks,
Manuel

Michael Musgrove

unread,
Jul 22, 2022, 11:39:42 AM7/22/22
to Manuel Finelli, narayana-users

--
You received this message because you are subscribed to the Google Groups "narayana-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to narayana-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/narayana-users/f7d794ca-ca41-43b5-9e5a-922220b2d6efn%40googlegroups.com.

Michael Musgrove

unread,
Jul 22, 2022, 3:25:57 PM7/22/22
to Manuel Finelli, narayana-users
If you want to keep things generic then a possibility could be to add a getTypes() method to the RecoveryModule interface to discover which types a module is managing.

Then call RecoveryEnvironmentBean.getRecoveryModules() to find the registered modules, and foreach module you can ask it for its types and then use the standard ObjectStoreAPI to find uids of those types.

Manuel Finelli

unread,
Jul 25, 2022, 4:39:50 AM7/25/22
to Michael Musgrove, narayana-users
I really like your idea to add getTypes() to the RecoveryModule interface. I will give it a try ASAP. Thank you very much Michael :-)
Reply all
Reply to author
Forward
0 new messages