Not able to enable Write-ahead logs using tx.log-tx for existing JanusGraph setup


Radhika Kundam
 

Hi All,

I am trying to enable write-ahead logs by using the config property: tx.log-tx to handle transaction recovery.
It's working fine for new JanusGraph setup but not working for Janusgraph setup which already used for some time.

Is it expected that tx.log-tx works only for fresh JanusGraph setup?
Do we need to follow any additional steps to enable tx.log-tx for existing Janusgraph setup.

Thanks,
Radhika


Boxuan Li
 

Is it expected that tx.log-tx works only for fresh JanusGraph setup?

No. It should work well for your existing JanusGraph setup too. Note that it is a GLOBAL option so it must be changed for the entire cluster. See https://docs.janusgraph.org/basics/configuration/#global-configuration

Best,
Boxuan


Radhika Kundam
 

Boxuan,

Thank you for the response. Will try again as mentioned in the configuration.

Regards,
Radhika


On Fri, Aug 6, 2021 at 11:53 PM Boxuan Li <liboxuan@...> wrote:
Is it expected that tx.log-tx works only for fresh JanusGraph setup?

No. It should work well for your existing JanusGraph setup too. Note that it is a GLOBAL option so it must be changed for the entire cluster. See https://docs.janusgraph.org/basics/configuration/#global-configuration

Best,
Boxuan


Radhika Kundam
 

Hi Boxuan,For existing JanusGraph setup, I am updating tx.log-tx configuration by setting management system property as mentioned in https://docs.janusgraph.org/basics/configuration/#global-configuration
And I could see the configuration updated properly in JanusGraphManagement.

managementSystem.get("tx.log-tx"); => prints false
managementSystem.set("tx.log-tx", true);
managementSystem.commit();
managementSystem.get("tx.log-tx"); => prints true

But this change is not reflected for logTransactions in 
GraphDatabaseConfiguration:preLoadConfiguration. 
graph.getConfiguration().hasLogTransactions() => prints false
While transaction recovery using StandardTransactionLogProcessor it checks for the argument graph.getConfiguration().hasLogTransactions() which is not having latest config('tx.log-tx') updated in ManagementSystem.
To reflect the change, I had to restart cluster two times. 
Also since it's GLOBAL property I am not allowed to override using graph.configuration() and only available option is to update through ManagementSystem which is not updating logTransactions.

I would really appreciate your help on this.

Thanks,
Radhika


Boxuan Li
 

I suspect this is due to stale management instances. Check out https://developer.ibm.com/articles/janusgraph-tips-and-tricks-pt-2/#troubleshooting-indexes and see if it helps.


Radhika Kundam
 

Hi Boxuan,

Thank you for the response. I tried by forceClosing all management instances except the current one before setting "tx.log-tx". Management is getting updated with latest value, this is not the issue even without closing other instances. The issue is graph.getConfiguration().hasLogTransactions() is not getting refreshed through JanusGraphManagement property update. My understanding is logTransactions will be updated only through GraphDatabaseConfiguration:preLoadConfiguration which will be called only when we open graph instance JanusGraphFactory.open(config).I don't see any setter method to update logTransactions when we update JanusGraphManagement property. Because of this after updating JanusGraphManagement when we restart cluster it's invoking  GraphDatabaseConfiguration:preLoadConfiguration which is updating logTransactions value then.

Please correct me if I am missing anything and it'll be really helpful if any alternative approach to update logTransaction when we update Management property without restarting the cluster.

Thanks,
Radhika


Boxuan Li
 

Hi Radhika,

Got it. You are right, you need to reopen the graph after setting `tx.log-tx`.


Radhika Kundam
 

Thank you Boxuan for the confirmation. I used the same approach of reopening graph as of now.

It would be good if "logTransactions" can be refreshed on update of tx.log-tx by providing setter method without reopening graph.
Because as per my understanding, reopening of graph is required only for this tx.log-tx management setting(but not for any other management settings) as this property should be reflected for logTransactions.