Skip to content

Conversation

@Anemy
Copy link
Member

@Anemy Anemy commented May 5, 2025

COMPASS-9150 COMPASS-9315

Marked for release notes as this could impact how folks analyze their schema, they should be able to abort more predictably now as we check for signal abort between each document being analyzed.

A bit of additional context, we have COMPASS-8925 for moving the rest of Compass to pass the abort signal to the driver's methods and get rid of some of our session workarounds in the data-service. This passing of an abort signal to the driver's aggregate method with the Abortable type that we have in this pr is the first we're doing it in Compass.

};
const schemaAccessor = await analyzeDocuments(docs, schemaParseOptions);
const schemaAccessor = await analyzeDocuments(
sampleCursor,
Copy link
Member Author

@Anemy Anemy May 5, 2025

Choose a reason for hiding this comment

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

This could impact performance. I have not tested that. Should we?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Any specific concerns or predictions for where the biggest impact might be? I def defer to another team member to give you an answer here, but as a newbie what would it entail to validate at least the biggest bottlenecks we think may come up here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Now we're checking if the signal is aborted between every document parsing. I don't think that would be any overhead. The part I think something could change is just that we don't do the toArray and then pass all of the documents synchronously, now the schema analysis will wait longer if there are any round trips. I don't think that would slow things down either really, but I wanted to raise it to make sure it's something on our minds.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry didn't get back sooner. I agree, we've shifted the cost but in a way that should leave the app a bit more responsive as it acts on a document at a time. Plus this takes advantage of the driver's lazy deserialize. In the end the time spent should be the equivalent, broken up over more event loop cycles

@Anemy Anemy changed the title fix(schema, data-modeling): update schema analysis to use iterable cursor COMPASS-9150 COMPASS-9315 feat(schema, data-modeling): update schema analysis to use iterable cursor COMPASS-9150 COMPASS-9315 May 5, 2025
@github-actions github-actions bot added feat and removed fix labels May 5, 2025
@Anemy Anemy added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label May 5, 2025
@Anemy Anemy changed the title feat(schema, data-modeling): update schema analysis to use iterable cursor COMPASS-9150 COMPASS-9315 feat(schema, data-modeling): use iterable cursor in schema analysis COMPASS-9150 COMPASS-9315 May 5, 2025
};
const schemaAccessor = await analyzeDocuments(docs, schemaParseOptions);
const schemaAccessor = await analyzeDocuments(
sampleCursor,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any specific concerns or predictions for where the biggest impact might be? I def defer to another team member to give you an answer here, but as a newbie what would it entail to validate at least the biggest bottlenecks we think may come up here?

@Anemy Anemy merged commit 91a1ac6 into main May 8, 2025
74 of 79 checks passed
@Anemy Anemy deleted the COMPASS-9150-stream-documents-for-sample branch May 8, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants