-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Enable Metadata Table Writes #659
Conversation
runner/src/indexer/indexer.ts
Outdated
await this.deps.indexerMeta?.setStatus(status); | ||
} | ||
|
||
async setStoppedStatus (): Promise<void> { |
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.
Specifically for use by StreamHandler to set STOPPED status. It's possible the connection parameters/table aren't prepared so I try getting those first.
|
||
it('works', async () => { | ||
const hasuraClient = new HasuraClient({}, { | ||
beforeEach(async () => { |
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.
Moved declaration of hasura, pgClient, and provisioner to beforeEach since so far all tests use the same config.
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 for a different PR, but we should look in to setting up isolated containers/clients/config. Right now they are shared across tests which could lead to some issues.
Right now, the test context db
test probably only works since it has a different function name, which therefore forces it to provision. But if we used the same function name as the other tests it would fail.
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 it did fail originally, so I changed the function name haha. And yeah I agree. Definitely worth thinking about soon.
Tested FAILING indexers and had worker crash to verify setting of STOPPED status. All seems to be working. Setting of block height also works. |
Cannot be merged without #660 |
runner/src/indexer/indexer.ts
Outdated
@@ -89,14 +90,16 @@ export default class Indexer { | |||
|
|||
try { | |||
if (!await this.deps.provisioner.fetchUserApiProvisioningStatus(this.indexerConfig)) { | |||
// TODO: Remove call as setting PROVISIONING status is impossible with new table |
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.
Are we removing the PROVISIONING
status?
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.
Correct. It's no longer possible to set this status as we cannot guarantee the existence of the table. Most of the time, it won't be.
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.
No longer removing this. Setting of provisioning is now performed in Provisioner.
|
||
it('works', async () => { | ||
const hasuraClient = new HasuraClient({}, { | ||
beforeEach(async () => { |
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 for a different PR, but we should look in to setting up isolated containers/clients/config. Right now they are shared across tests which could lead to some issues.
Right now, the test context db
test probably only works since it has a different function name, which therefore forces it to provision. But if we used the same function name as the other tests it would fail.
00c8b8c
to
9c142fd
Compare
0a84c0c
to
965e657
Compare
Enable writes of Status and Last Processed Block Height to Metadata table. Reorganizes provisioning to ensure writing of PROVISIONING status. Ensures IndexerMeta is available for writing error logs.