Project

General

Profile

Story #7073

Create CN.synchronize API on cn_rest_service

Added by Jing Tao over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
d1_cn_service
Target version:
Start date:
2015-04-30
Due date:
% Done:

100%

Story Points:
Sprint:

Description

It can be cn.synchronize(pid) or cn.synchronizeObject(sysMeta). It mains priority queue(s) for d1_synchronize to access.


Related issues

Blocks Infrastructure - Task #7036: MN.updateSystemetadata calls CN.synchronize to update the system metadata on the cn Closed 2015-04-10
Precedes CN REST - Story #7206: Verify push system metadata changes are implemented Rejected 2015-05-01 2015-05-01

Associated revisions

Revision 15789
Added by Rob Nahf over 9 years ago

refs #7073: Refactored SyncObject to d1_cn_common to enable cn.synchronize in d1_cn_rest, added initial cn.synchronize implementation to cn.rest.web.node.v2.NodeController

Revision 15789
Added by Rob Nahf over 9 years ago

refs #7073: Refactored SyncObject to d1_cn_common to enable cn.synchronize in d1_cn_rest, added initial cn.synchronize implementation to cn.rest.web.node.v2.NodeController

History

#2 Updated by Jing Tao over 9 years ago

  • Blocks Task #7036: MN.updateSystemetadata calls CN.synchronize to update the system metadata on the cn added

#3 Updated by Jing Tao over 9 years ago

For CN.syncrhonize, only the authoritative MN can call it.

#4 Updated by Skye Roseboom over 9 years ago

  • Precedes Story #7206: Verify push system metadata changes are implemented added

#5 Updated by Skye Roseboom over 9 years ago

  • Target version changed from CCI-2.0.0 to CCI-2.0-TRUNK

#6 Updated by Rob Nahf over 9 years ago

  • Assignee changed from Robert Waltz to Rob Nahf
  • % Done changed from 0 to 30
  • Status changed from New to In Progress

Created an initial implementation in d1_cn_rest v2.NodeController (since it has to access the nodeRegistry).
The implemented method introduces access to Hazelcast systemMetadata map and sync queue.
Also refactors the SyncObject type to d1_cn_common.

#7 Updated by Dave Vieglais over 9 years ago

  • Target version changed from CCI-2.0-TRUNK to CCI-2.0.0

#8 Updated by Jing Tao over 9 years ago

When the MN node calls the method cn.synchronize method, it gets those error:

org.dataone.service.exceptions.ServiceFailure: Unexpected Exception:: java.lang.NullPointerException
at org.dataone.service.util.ExceptionHandler.deserializeXml(ExceptionHandler.java:633)
at org.dataone.service.util.ExceptionHandler.deserializeXmlAndThrowException(ExceptionHandler.java:517)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:363)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:313)
at org.dataone.service.util.ExceptionHandler.filterErrors(ExceptionHandler.java:107)
at org.dataone.service.util.ExceptionHandler.filterErrors(ExceptionHandler.java:82)
at org.dataone.client.rest.HttpMultipartRestClient.doPostRequest(HttpMultipartRestClient.java:448)
at org.dataone.client.v2.impl.MultipartCNode.synchronize(MultipartCNode.java:702)
at edu.ucsb.nceas.metacat.dataone.MNodeService.updateSystemMetadata(MNodeService.java:2245)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.updateSystemMetadata(MNResourceHandler.java:1638)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.handle(MNResourceHandler.java:269)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doPut(D1RestServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:649)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at edu.ucsb.nceas.metacat.restservice.D1URLFilter.doFilter(D1URLFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
metacat 20150721-00:05:40: [ERROR]: Can't update the systemmetadata of pid tao.13343.1 in CNs since Unexpected Exception:: java.lang.NullPointerException [edu.ucsb.nceas.metacat.dataone.MNodeService]

#9 Updated by Rob Nahf over 9 years ago

Jing, what's the detail code associated with the ServiceFailure? It would be very helpful in narrowing down the source of the NPE.

The stacktrace suggests that the trouble is with deserializing the cn.synchronize response. The ExceptionHandler code looks pretty tight, and there's not much chance of it being a problem with the error response, unless it's empty, or the HTTP status is mistakenly not 200 range.

#10 Updated by Jing Tao over 9 years ago

Rob, the detail code is 4961 and the code is 500:

metacat 20150721-22:00:36: [DEBUG]: Entry added/updated to System Metadata map: tao.13350.1 [edu.ucsb.nceas.metacat.dataone.hazelcast.HazelcastService]
org.dataone.service.exceptions.ServiceFailure: Unexpected Exception:: java.lang.NullPointerException
at org.dataone.service.util.ExceptionHandler.deserializeXml(ExceptionHandler.java:633)
at org.dataone.service.util.ExceptionHandler.deserializeXmlAndThrowException(ExceptionHandler.java:517)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:363)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:313)
at org.dataone.service.util.ExceptionHandler.filterErrors(ExceptionHandler.java:107)
at org.dataone.service.util.ExceptionHandler.filterErrors(ExceptionHandler.java:82)
at org.dataone.client.rest.HttpMultipartRestClient.doPostRequest(HttpMultipartRestClient.java:448)
at org.dataone.client.v2.impl.MultipartCNode.synchronize(MultipartCNode.java:702)
at edu.ucsb.nceas.metacat.dataone.MNodeService.updateSystemMetadata(MNodeService.java:2245)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.updateSystemMetadata(MNResourceHandler.java:1638)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.handle(MNResourceHandler.java:269)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doPut(D1RestServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:649)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at edu.ucsb.nceas.metacat.restservice.D1URLFilter.doFilter(D1URLFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
metacat 20150721-22:00:37: [ERROR]: It is a DataONEBaseException and its detail code is 4961 and its code is 500 [edu.ucsb.nceas.metacat.dataone.MNodeService]
metacat 20150721-22:00:37: [ERROR]: Can't update the systemmetadata of pid tao.13350.1 in CNs since Unexpected Exception:: java.lang.NullPointerException [edu.ucsb.nceas.metacat.dataone.MNodeService]

#11 Updated by Ben Leinfelder over 9 years ago

  • % Done changed from 30 to 50
  • Status changed from In Progress to Testing

Instead of using a new Hazelcast "instance" I changed the cn.synch method to use a "client" in order to read SM and submit synch tasks to the queue. This is now deployed in cn-dev environment - please test when mnDemoX certificates are renewed.

#12 Updated by Ben Leinfelder over 9 years ago

  • % Done changed from 50 to 100
  • Status changed from Testing to Closed

Tested on mn-demo-6 content in cn-dev and saw that updated MN systemMeta was synchronized to the CN.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)