Skip to content
This repository was archived by the owner on Oct 3, 2026. It is now read-only.
This repository was archived by the owner on Oct 3, 2026. It is now read-only.

[Bug Report] Wrong Unlock #336

Open
Open

Description

@qingzhu521

if you try

            TrinityConfig.CurrentRunningMode = RunningMode.Client;
            try {
                KCoreCell node_ins = Global.CloudStorage.LoadKCoreCell(0);
            }
            catch (Exception ex) {
                Console.WriteLine("cell not found");
            }
            var neighbors = new List<long>();
            Global.CloudStorage.SaveKCoreCell(0, alive: false, remain_nodes: 0, neighbors);

this code the server will break this is for in

            #region LoadCell
            tupleList.Add(new TypeSyncRequestResponseHandlerTuple
            {
                Id = (ushort)RequestType.LoadCell,
                Handler = delegate(SynReqRspArgs args)
                {
                    int index, cellSize;
                    byte* cellPtr = null;
                    TrinityErrorCode eResult;
                    long cellId = *(long*)(args.Buffer + args.Offset);
                    if ((eResult = CLocalMemoryStorage.CGetLockedCellInfo4LoadCell(cellId, out cellSize, out cellPtr, out index)) == TrinityErrorCode.E_CELL_NOT_FOUND)
                    {
                        args.Response = new TrinityMessage(eResult);
                    }
                    else
                    {
                        args.Response = new TrinityMessage(eResult, cellSize);
                        Memory.memcpy(args.Response.Buffer + TrinityMessage.Offset, cellPtr, (ulong)cellSize);
                    }
                    Log.WriteLine(LogLevel.Info, "Load Crelease lock {0} id {1} index", cellId, index);
                    CLocalMemoryStorage.CReleaseCellLock(cellId, index);
                }
            });

The storage will release the lock. But in load process there don't exit any lock on the cell.

            uint8_t MTHash::ReleaseEntryLock(const int32_t index)
            {
                    if (TrinityConfig::ReadOnly())
                         return 0;
                   Trinity::Diagnostics::WriteLine(Trinity::Diagnostics::Info, "UnKnow Release index {0} LOCK {1}", index, (int)MTEntries[index].EntryLock);
                  return (MTEntries[index].EntryLock.fetch_add(-1, std::memory_order_release) - 1);
           }

this code will put the entrylock into -1.

Activity

  1. qingzhu521 commented on Aug 5, 2021

    @qingzhu521
    Author

    image

    The line 61 should be in 58 Bracket

  2. TaviTruman commented on Aug 7, 2021

    @TaviTruman
    Contributor

    qingzhu (@qingzhu521) Thanks for reporting this and sorry for this oversight; I will include a new unit-test case to sniff this out. I can't update this repo but I will update my forked repo and get the fix in this coming week. I'll also post where one can get the new Nuget packages.

  3. TaviTruman commented on Dec 1, 2021

    @TaviTruman
    Contributor

    qingzhu (@qingzhu521) I have a new fork of the Graph Engine here: https://github.com/InKnowWorks/IKW-GraphEngine. We have a lot of updates coming to address bugs, updated and additional documentation as well as new capabilities in the new year.

  4. TaviTruman commented on Apr 4, 2022

    @TaviTruman
    Contributor

    I'm testing a fix for this issue this week; I will keep you posted.

  5. shaobin commented on May 22, 2022

    @shaobin
    Contributor

    qingzhu (@qingzhu521) Thanks for reporting this! Tavi Truman (@TaviTruman) , Thank you for trying to address this!

    qingzhu (@qingzhu521) Could you help provide the minimal source code (with TSL etc.) that can reproduce this issue? I'd like to take a look at this issue.

  6. qingzhu521 commented on May 24, 2022

    @qingzhu521
    Author

    Kcore.txt
    GraphEng.txt
    Bin Shao (@shaobin) There has been some time since this program, But I think this is the code. I try to implement KCore algorithm in Trinity which trigger this problem.

  7. shaobin commented on May 24, 2022

    @shaobin
    Contributor

    qingzhu (@qingzhu521) Thank you. I'll check out your code.

  8. TaviTruman commented on Oct 18, 2022

    @TaviTruman
    Contributor

    Bin Shao (@shaobin) Did we get time to review this in detail? I think I am running into the same problem.

  9. TaviTruman commented on Dec 2, 2022

    @TaviTruman
    Contributor

    qingzhu (@qingzhu521) Hi, did you ever get any type of resolution this your problem?

  10. qingzhu521 commented on Dec 9, 2022

    @qingzhu521
    Author

    I think we can review this problem togather.

  11. qingzhu521 commented on Dec 9, 2022

    @qingzhu521
    Author

    Tavi Truman (@TaviTruman) I think is not hard to reproduce this problem. I just write a program that every time trinity can deal with a batch of data. Then the bug produced.

  12. TaviTruman commented on Dec 9, 2022

    @TaviTruman
    Contributor

    qingzhu (@qingzhu521) I have isolated the code template in the TSL Code Generator (C++). I will rebuild and test when I get a free hour or so. I'll also add a new test in the build.

  13. TaviTruman commented on Dec 9, 2022

    @TaviTruman
    Contributor

    qingzhu (@qingzhu521) Are you using the DataImporter?

  14. qingzhu521 commented on Dec 30, 2022

    @qingzhu521
    Author

    yes

  15. TaviTruman commented on Dec 30, 2022

    @TaviTruman
    Contributor

    Cool. I have a number of fixes and updates. I don't think the Dataimporter is supported in the repo. Have you made any updates to the utility. I'm working to prepare a PR for this repo UT have already updated my forked repo copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions