-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Migration v2 waits for yellow cluster #96788
Migration v2 waits for yellow cluster #96788
Conversation
otherwise the next request to Elasticsearch can fail
Pinging @elastic/kibana-core (Team:Core) |
@@ -85,11 +87,12 @@ export async function migrationStateActionMachine({ | |||
model: Model<State>; | |||
}) { | |||
const executionLog: ExecutionLog = []; | |||
const starteTime = performance.now(); |
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.
@rudolf I'm not sure we need such high precision. I rolled back to the standard Date instead. Let me know if I should revert the change.
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 Date.now()
is good enough.
}); | ||
test('INIT -> SET_SOURCE_WRITE_BLOCK when migrating from a v2 migrations index (>= 7.11.0)', () => { | ||
test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a v2 migrations index (>= 7.11.0)', () => { |
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.
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.
yes, it would be great to document it there.
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.
Wondered about adding an integration test, otherwise looks good.
const asyncUnlink = Util.promisify(Fs.unlink); | ||
async function removeLogFile() { | ||
// ignore errors if it doesn't exist | ||
await asyncUnlink(logFilePath).catch(() => void 0); |
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.
nice :)
@@ -85,11 +87,12 @@ export async function migrationStateActionMachine({ | |||
model: Model<State>; | |||
}) { | |||
const executionLog: ExecutionLog = []; | |||
const starteTime = performance.now(); |
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 Date.now()
is good enough.
}); | ||
test('INIT -> SET_SOURCE_WRITE_BLOCK when migrating from a v2 migrations index (>= 7.11.0)', () => { | ||
test('INIT -> WAIT_FOR_YELLOW_SOURCE when migrating from a v2 migrations index (>= 7.11.0)', () => { |
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.
yes, it would be great to document it there.
Pull request was converted to draft
src/core/server/saved_objects/migrationsv2/integration_tests/actions.test.ts
Outdated
Show resolved
Hide resolved
src/core/server/saved_objects/migrationsv2/integration_tests/actions.test.ts
Outdated
Show resolved
Hide resolved
…ctions.test.ts Co-authored-by: Rudolf Meijering <[email protected]>
…ctions.test.ts Co-authored-by: Rudolf Meijering <[email protected]>
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
💔 Backport failed
To backport manually run: |
* migrator waits for source index to be yellow otherwise the next request to Elasticsearch can fail * unskip integration tests that failed due to a red cluster * log how much the every step lasts * use Date.now instead of performance.now migration cannot finish in ms * update tests * clean log file before running tests * fix wrong type * add an integration test for waitForIndexStatusYellow # Conflicts: # src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts
* migrator waits for source index to be yellow otherwise the next request to Elasticsearch can fail * unskip integration tests that failed due to a red cluster * log how much the every step lasts * use Date.now instead of performance.now migration cannot finish in ms * update tests * clean log file before running tests * fix wrong type * add an integration test for waitForIndexStatusYellow # Conflicts: # src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts
* Migration v2 waits for yellow cluster (#96788) * migrator waits for source index to be yellow otherwise the next request to Elasticsearch can fail * unskip integration tests that failed due to a red cluster * log how much the every step lasts * use Date.now instead of performance.now migration cannot finish in ms * update tests * clean log file before running tests * fix wrong type * add an integration test for waitForIndexStatusYellow # Conflicts: # src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts * remove tests using so from v8 * skip as on master :(
* Migration v2 waits for yellow cluster (#96788) * migrator waits for source index to be yellow otherwise the next request to Elasticsearch can fail * unskip integration tests that failed due to a red cluster * log how much the every step lasts * use Date.now instead of performance.now migration cannot finish in ms * update tests * clean log file before running tests * fix wrong type * add an integration test for waitForIndexStatusYellow # Conflicts: # src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts * remove test using so from v8 * skip as on master Co-authored-by: Kibana Machine <[email protected]>
Summary
Closes #91107
This PR tries to stabilize the SO integration tests that fail since Kibana sent reindex requests to the red cluster.
Also, I added logs on how long every state transition lasts.
Checklist
Delete any items that are not applicable to this PR.