Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented distributed cache over LLS. #1200

Closed

Conversation

ljcollins25
Copy link
Member

No description provided.

/// <returns>
/// Result providing the call's completion status. True if the replacement was completed successfully, false otherwise.
/// </returns>
public static Possible<bool> CompareExchange(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to start using 'Possible' types from BuildXL.Utilities?

I think it is a bit confusing to introduce yet another result type here...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the type was introduced already... But the question still holds...


In reply to: 345368562 [](ancestors = 345368562)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, why not to use BoolResult here instead?


In reply to: 345368790 [](ancestors = 345368790,345368562)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is code I originally wrote a few months ago. Used CompareExchange because I didn't know how to convert to BoolResult


In reply to: 345369015 [](ancestors = 345369015,345368790,345368562)

default:
throw new ArgumentOutOfRangeException($"Unknown event kind '{kind}'.");
}
}

/// <nodoc />
public void Serialize(BuildXLWriter writer)
public virtual void Serialize(BuildXLWriter writer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but curious why you decided to use another pattern here?

Before the full dispatch was happened here, and now it is virtual. I think it make sense to stay consistent unless there is a reason to follow different pattern in different cases.

/// </summary>
public bool TryGetLocalLocationStore(out LocalLocationStore localLocationStore)
{
if (_contentLocationStore is TransitioningContentLocationStore tcs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is interesting that TryGetLocalLocationStore is quite different from LocalLocationStore property.

One may think that these two are the same and one is implemented on top of another. But only the 'TryGet' one will return false in case if the store is disabled.

@ljcollins25
Copy link
Member Author

        if (_contentLocationStore is TransitioningContentLocationStore tcs

TryGetLocalLocationStore


Refers to: Public/Src/Cache/ContentStore/Distributed/Stores/DistributedContentStore.cs:553 in d458a79. [](commit_id = d458a79, deletion_comment = False)

@jbayardo
Copy link
Member

    public (LocalContentServer contentServer, LocalCacheServer cacheServer) Create()

This should be turned into IStartupShutdown or similar


Refers to: Public/Src/Cache/DistributedCache.Host/Service/Internal/CacheServerFactory.cs:47 in d458a79. [](commit_id = d458a79, deletion_comment = False)

@@ -15,13 +15,13 @@ internal class RedisMemoizationStore : DatabaseMemoizationStore
{
/// <nodoc />
private RedisMemoizationStore(ILogger logger, IClock clock, RedisDatabaseAdapter redis, TimeSpan memoizationExpiryTime)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILogger logger [](start = 38, length = 14)

Logger is not being used any more

@@ -15,13 +15,13 @@ internal class RedisMemoizationStore : DatabaseMemoizationStore
{
/// <nodoc />
private RedisMemoizationStore(ILogger logger, IClock clock, RedisDatabaseAdapter redis, TimeSpan memoizationExpiryTime)
: base(logger, new RedisMemoizationDatabase(redis, clock, memoizationExpiryTime))
: base(new RedisMemoizationDatabase(redis, clock, memoizationExpiryTime))
{
}

/// <nodoc />
public RedisMemoizationStore(ILogger logger, RedisMemoizationDatabase database)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILogger logger [](start = 37, length = 14)

Same here

@@ -42,7 +42,7 @@ public class DistributedCacheSessionTracer : MemoizationStoreTracer, IMetadataCa
/// Initializes a new instance of the <see cref="DistributedCacheSessionTracer" /> class.
/// </summary>
public DistributedCacheSessionTracer(ILogger logger, string name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILogger logger, [](start = 45, length = 15)

Logger not used anymore

@@ -34,7 +34,7 @@ public class SQLiteMemoizationStoreTracer : MemoizationStoreTracer, ISQLiteDatab
/// <param name="logger">Logger</param>
/// <param name="name">Tracer Name</param>
public SQLiteMemoizationStoreTracer(ILogger logger, string name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILogger logger, [](start = 44, length = 15)

Logger not used anymore


// Update the entry if the current entry is newer
// TODO: Use real versioning scheme for updates to resolve possible race conditions and
// issues with time comparison due to clock skew
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment explaining why this isn't a frequent enough occurrence so as to care?

var redisStore = (RedisGlobalStore)localLocationStore.GlobalStore;

MemoizationStore = new DatabaseMemoizationStore(new DistributedMemoizationDatabase(
localLocationStore,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When ContentLocationDatabase is created without MetadataGarbageCollectionEnabled=true, metadata GC won't run. As things are right now, the CLDB instance won't perform any metadata GC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants