Details

    • Type: Bug
    • Status: Open
    • Priority: On Hold
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: None
    • Labels:
      None
    • Platform:
      All
    • Sprint:

      Description

      I've found a bug in MongoQueryFactory. When I search an LRU space for "id=1 OR id=2" I can see in the debugger that it searches mongo using {_id:2} instead of {$or: {_id:1, _id:2}}. Here is a snippet from the attached test project:

      // write objects
      gigaSpace.write(new PersistedSpaceClass(1L));
      gigaSpace.write(new PersistedSpaceClass(2L));

      // query them
      Assert.assertEquals(1, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=1"), 5, ReadModifiers.MEMORY_ONLY_SEARCH).length);
      Assert.assertEquals(1, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=2"), 5, ReadModifiers.MEMORY_ONLY_SEARCH).length);
      Assert.assertEquals(2, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=1 OR id=2"), 5, ReadModifiers.MEMORY_ONLY_SEARCH).length);

      // wait for objects to show up in mongo and evict them from the space
      String collectionName = "xaptest.MongoDataSourceTest__d_s__PersistedSpaceClass";
      for (; mongoTemplate.count(new Query(), collectionName) != 2; Thread.sleep(100));
      gigaSpace.clear(null, ClearModifiers.EVICT_ONLY);

      // query them again
      Assert.assertEquals(2, gigaSpace.readMultiple(new SQLQuery<>(PersistedSpaceClass.class, "id=1 OR id=2")).length);

      The test fails on the last assert: "expected:<2> but was:<1>".

      The test is attached.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Yuvald Yuval Dori (Inactive)
              Participants of an issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: