Project

General

Profile

Task #3263

GMN node has the problem to handle the calling: mn.listObjects()

Added by Jing Tao about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
d1_mn_GMN
Start date:
2012-09-26
Due date:
% Done:

100%

Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

When I call mn.listObjects against a GMN node, I found the GMN give me a double size of the objects residing in it.

Chris Jones wrote a small test program:

package org.dataone.tests;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dataone.client.D1Client;
import org.dataone.client.MNode;
import org.dataone.service.exceptions.BaseException;
import org.dataone.service.types.v1.ObjectInfo;
import org.dataone.service.types.v1.ObjectList;

public class MNodeListObjectsTest {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Log log = LogFactory.getLog(MNodeListObjectsTest.class);

        log.debug("[" + Thread.currentThread().getName() + "] created.");

        MNode mn = null;

        mn = D1Client.getMN("https://mn-demo-1.test.dataone.org/knb/d1/mn");
        try {
            ObjectList list = mn.listObjects();
            log.debug("list size: " + list.sizeObjectInfoList());

            List<ObjectInfo> infoList = list.getObjectInfoList();
            log.debug("infoList size: " + infoList.size());

        } catch (BaseException e) {
            e.printStackTrace();
        }

    }

}

This test works very well for the server https://mn-demo-1.test.dataone.org/knb/d1/mn.

However, when i change the mn base url to https://nibbler.nceas.ucsb.edu/mn, print out is:
list size: 20
infoList size: 20

However, the browser https://nibbler.nceas.ucsb.edu/mn/v1/object gave me:

The size doesn't match: one is 20, the other is 10.

So we guess GMN node has an issue to handle the mn.listObjects().

History

#1 Updated by Jing Tao about 12 years ago

The two results not match is not due to the access control. First, i am the only one playing the GMN node and everything i put into the server is public readable. Second we tested twice against the GMN. The first time, the browser showed 33 objects and listObjects() showed 66 objects. And a print-out showed:

0the identifier is SNAP_PRC_CRU8bc5df22-ab45-4265-8158-c9402a1911cb
1the identifier is SNAP_PRC_CRU8bc5df22-ab45-4265-8158-c9402a1911cb

After deleting those objects in the GMN, i created another 10 objects. Then we tested again. This time the browser showed it 10 objects and listObjects() showed 20 objects. So each time the listObjects got the double size.

#2 Updated by Chris Jones about 12 years ago

  • Target version set to Sprint-2012.39-Block.5.4
  • Assignee set to Rob Nahf
  • Category set to d1_libclient_java

After talking with Roger and Rob, it looks like this may be an issue with MNode. It's odd that it works fine against mn-demo-1, and not nibbler. Assigning this to Rob to take a look.

#3 Updated by Rob Nahf about 12 years ago

  • Assignee changed from Rob Nahf to Roger Dahl
  • Category changed from d1_libclient_java to d1_mn_GMN
  • Status changed from New to In Progress

hitting the /object endpoint from chrome, nibbler gives me 5 total objects. Using MNode in libclient, I get the same number (5), using the same two ways listed in the sample program.

MNode is giving the expected result, so the problem likely lies elsewhere.

#4 Updated by Jing Tao about 12 years ago

Hi, Rob:

I ran the code which chrise wrote again ( a little bit modification). Here is the result:
20120928-13:47:06: [WARN]: list size: 10 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: infoList size: 10 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_PRC_CRU:694acfd6e0fd6a774dc7060c4ca58fcc [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_PRC_CRU:694acfd6e0fd6a774dc7060c4ca58fcc [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_A1B:cde09023e77ec888708b8092bc5ba255 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_A1B:cde09023e77ec888708b8092bc5ba255 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_TAVE_CRU:6c917cdbe886e89db00bf5cbe55969dd [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_TAVE_CRU:6c917cdbe886e89db00bf5cbe55969dd [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_B1_A2:f9aeff8871dcc0cbeb5780547f943bc0 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : SNAP_B1_A2:f9aeff8871dcc0cbeb5780547f943bc0 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : resource-map:fd8f51fa-9474-408a-9610-f4a59576cf85 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]
20120928-13:47:06: [WARN]: id : resource-map:fd8f51fa-9474-408a-9610-f4a59576cf85 [edu.ucsb.nceas.evos.thredds.ThreddsObjectRegisterTest]

You see the size is 10 and there are duplicate ids.

It is odd that yours worked, mine failed.

#5 Updated by Jing Tao about 12 years ago

Roger and I did more test.
Accidentally, i found if there is no cilogon certificates in the tmp dir, the code will give you 5 objects. But if it has one, it will give you 10 objects.
Roger think the client will receive twice responds: one is as public and the other will be the authenticated user.

#6 Updated by Roger Dahl about 12 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)