-
Notifications
You must be signed in to change notification settings - Fork 532
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
Stop using short data store IDs in detached container #21613
Conversation
* | ||
* While we figure out the fix, we are disabling the ability to create short IDs and this assert validates it. | ||
*/ | ||
function assertInvert(value: unknown, message: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's unknown, not boolean type? All the cases seem to be boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to boolean
assert(typeof idTest === "number", "short IDs should be issued"); | ||
assert(idTest >= 0, "finalId"); | ||
assertInvert(typeof idTest === "number", "short IDs should be issued"); | ||
// assert(idTest >= 0, "finalId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe be roll it into previous assert? I.e.
assertInvert(typeof idTest === "number" && idTest >= 0, "short IDs should be issued");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
const dataStore1 = | ||
await defaultDataStore.context.containerRuntime.createDataStore(TestDataObjectType); | ||
const ds1 = (await dataStore1.entryPoint.get()) as ITestFluidObject; | ||
assertInvert( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this test and create 100 of detached data stores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could but I don't see a point. Are you suggesting we the load a container and basically validate that it can load all these data stores, process ops, etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you need 13 to create a datastore with id "["
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but there is no repro of the issue even with that. So, I don't see a point in doing it yet. Once we have a repro, we can add test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.dataStoreContext.containerRuntime.generateDocumentUniqueId?.() ?? uuid(); | ||
id = typeof res === "number" ? encodeCompactIdToString(2 * res + 1, "_") : res; | ||
} | ||
// if (this.visibilityState !== VisibilityState.GloballyVisible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put all of these changes behind a feature flag, for easy toggles in DF/PROD?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I see the value in doing that because we can't enable it unless we fix the bug which will require making code changes anyway. We can enable it via that change and add feature flags if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hear you there. Feature flag might come handy, if the issue happens to be on ODSP side, and we can just toggle our change off without making a code change. Since the true-root-cause is still being figured out, there may be value in keeping this change behind a switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add it behing a feature. But I doubt we will use it (Loop would probably not let us it being so risky). Also, we heard from ODSP that it's not their issue most likely.
Let me work on adding a feature, it doesn't hurt :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added feature flags
Any side-effects of turning off short-ids that we should know about or consider before merging? |
⯅ @fluid-example/bundle-size-tests: +806 Bytes
Baseline commit: d2ba7eb |
AFAIK, there shouldn't be. I will defer to @vladsud to double check. |
We are not attempting to recover existing documents. Change impacts new documents only (it will make them work again). |
Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.
## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.
Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.
Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state. (cherry picked from commit 1c00d7e)
## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.
…21613) (#21628) Porting 1c00d7e to rc 3 branch. ## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is [ but in a downloaded snapshot, it is converted to its ASCII equivalent %5B in certain conditions. So, when an op comes for this data store with id [, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from [ -> %5B. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.
…21613) (#21631) Porting 1c00d7e to rc 2 branch. ## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state. --------- Co-authored-by: Navin Agarwal <45832642+agarwal-navin@users.noreply.github.com>
) (#21629) Porting 1c00d7e to 2.0 branch. ## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is [ but in a downloaded snapshot, it is converted to its ASCII equivalent %5B in certain conditions. So, when an op comes for this data store with id [, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from [ -> %5B. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.
…21613) (#21630) Porting 1c00d7e to RC4.0 branch. ## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is [ but in a downloaded snapshot, it is converted to its ASCII equivalent %5B in certain conditions. So, when an op comes for this data store with id [, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from [ -> %5B. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state. --------- Co-authored-by: Navin Agarwal <45832642+agarwal-navin@users.noreply.github.com>
…21613) (#21632) Porting 1c00d7e to rc5 branch. ## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state. Co-authored-by: Navin Agarwal <45832642+agarwal-navin@users.noreply.github.com>
## Bug Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is `[` but in a downloaded snapshot, it is converted to its ASCII equivalent `%5B` in certain conditions. So, when an op comes for this data store with id `[`, containers loaded with this snapshot cannot find the data store. ## Root-cause We haven't yet identified what causes the id to change from `[` -> `%5B`. However, we know that it is caused by short IDs generated in detached container. ## Fix To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.
Bug
Currently, data stores created in detached container always get a short ID via id compressor. We have a bug in one of our customer's app where a short data store ID created is
[
but in a downloaded snapshot, it is converted to its ASCII equivalent%5B
in certain conditions. So, when an op comes for this data store with id[
, containers loaded with this snapshot cannot find the data store.Root-cause
We haven't yet identified what causes the id to change from
[
->%5B
. However, we know that it is caused by short IDs generated in detached container.Fix
To mitigate the issue for customers, this PR disables the generation of short IDs for data stores and DDSes. Added tests that validate that we don't generate short IDs for data stores and DDSes in detached or attached state.