question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Iterate over the keys written with different `ClientSession<>` instance, in the same file.

See original GitHub issue

I am iterating Iterate() over the keys , but only keys from the same ClientSession<> are being populated. I want to read/write in/from the same file, which is being closed(process shut down), without being deleted and opened again(Devices.CreateLogDevice). recoverDevice: true does not solve it.

Expected: All Keys/Values are Iterated, regardless of the ClientSession<> used to persist them. Actual: The results I receive are only from the current ClientSession<>.

I am interating over the key/values as per documentation:

            var dict = new Dictionary<int, RequestLogValue>();
            var scanInterator = requestLog.ClientSession.Iterate();
            while (scanInterator.GetNext(out var recordInfo))
            {
                ref RequestLogKey key = ref scanInterator.GetKey();
                ref RequestLogValue value = ref scanInterator.GetValue();

                dict.Add(key.Key, value);
            }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
badrishccommented, Aug 26, 2021

You can take a checkpoint after every update (or batch of updates) to the store. TakeHybridLogCheckpoint is fast and Incremental if you use FoldOver. Or you can have a background thread checkpointing every X seconds/minutes.

1reaction
badrishccommented, Aug 26, 2021

For the data in the store to survive process restart, you have to take a checkpoint before killing the process. And then, you have to Recover after process restart. Only then will the old data be available. See checkpoint recovery details in our docs and samples.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iterate dictionary multiple values by keys in python
I want to find most optimal way to iterate values in key in python. I have file with that structure: 17 key1. 18...
Read more >
Client Quickstart — aiohttp 3.8.4 documentation
Now, we have a ClientSession called session and a ClientResponse object called resp . We can get all the information we need from...
Read more >
Client Reference — aiohttp 3.8.5 documentation
Client session is the recommended interface for making HTTP requests. Session encapsulates a connection pool (connector instance) and supports keepalives by ...
Read more >
Context Managers and Python's with Statement
In this example, you write a with statement with os.scandir() as the context manager supplier. Then you iterate over the entries in the...
Read more >
Async IO in Python: A Complete Walkthrough
This tutorial will give you a firm grasp of Python's approach to async IO, which is a concurrent programming design that has received...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found