To be Reviewed By: Geode Dev
Authors: Jinmei Liao
Status: Draft | Discussion | Active | Dropped | Superseded
Superseded by: N/A
Related: N/A
Problem
Each locator will have an instance of CMS running. Multiple invocations of CRUD operation may happen at the same. We need to make sure that these calls are done in a serial fashion, not intertwined.
Anti-Goals
N/A
Solution
Each CMS needs to have a dlock service, when CRUD operation is started, needs to obtain a dedicated dlock to proceed.
At service initialization time, needs to create this dlock service:
private static DistributedLockService getCMSLockService(InternalDistributedSystem ds) { DistributedLockService cmsLockService = DLockService.getServiceNamed(CMS_NAME); try { if (cmsLockService == null) { cmsLockService = DLockService.create(CMS_NAME, ds, true, true); } } catch (IllegalArgumentException ignore) { return DLockService.getServiceNamed(CMS_NAME); } return cmsLockService; }
And then, in the beginning/end of each CRUD operation, do a set of lock/unlock
public boolean lockCMS() { return cmsLockService.lock(CMS_NAME, -1, -1); } public void unlockCMS() { cmsLockService.unlock(CMS_NAME); }
Changes and Additions to Public Interfaces
N/A
Performance Impact
There would some slight performance impact since now every CRUD operation through CMS will be serialized, even if they are initiated on different locators. But since these operations are not frequent in the system, the performance impact can be tolerated.
Backwards Compatibility and Upgrade Path
Will the regular rolling upgrade process work with these changes? Yes
How do the proposed changes impact backwards-compatibility? Are message or file formats changing? No
Is there a need for a deprecation process to provide an upgrade path to users who will need to adjust their applications? No
Prior Art
What would be the alternatives to the proposed solution? What would happen if we don’t solve the problem? Why should this proposal be preferred?
FAQ
Answers to questions you’ve commonly been asked after requesting comments for this proposal.
Errata
What are minor adjustments that had to be made to the proposal since it was approved?