Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Conversation

@nablaone
Copy link
Member

@nablaone nablaone commented Jun 12, 2025

Quesma relies on attributes columns when it calculates the schema change on ingest. Table discovery didn't add these fields to virtual tables. Therefore, the schema of the index stored in the common table becomes immutable within 60 seconds.

@nablaone nablaone marked this pull request as ready for review June 12, 2025 10:27
@nablaone nablaone requested a review from a team as a code owner June 12, 2025 10:28
Copy link
Contributor

@jakozaur jakozaur left a comment

Choose a reason for hiding this comment

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

Test should be faster.

assert.Equal(t, http.StatusOK, resp.StatusCode)

// wait for internal processing, especially for the periodic task that updates the schema
time.Sleep(60 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, this is very tricky to add. Slow IT are hard to debug and takes a lot to some engineering.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I know.

I will add an endpoint to reload tables.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed the test. Added endpoint. And fixed "eventually consistent" index that keeps a list of virtual tables.

@nablaone
Copy link
Member Author

/run-it

1 similar comment
@nablaone
Copy link
Member Author

/run-it

Copy link
Contributor

@jakozaur jakozaur left a comment

Choose a reason for hiding this comment

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

Can be merged, but move it to admin interface.

func (a *OnlyCommonTableTestcase) testAlterVirtualTable(ctx context.Context, t *testing.T) {

reloadTables := func() {
resp, body := a.RequestToQuesma(ctx, t, "POST", "/_quesma/reload-tables", nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should put that method under our admin port, not on ElasticSearch frontend.

As we are rushing with release fine to do in next PR.

return &quesma_api.Result{Body: string(body), StatusCode: http.StatusOK, GenericResult: body}, nil
})

router.Register(routes.QuesmaReloadTablsPath, method("POST"), func(ctx context.Context, req *quesma_api.Request, _ http.ResponseWriter) (*quesma_api.Result, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, please move this to admin interface.

@nablaone nablaone added this pull request to the merge queue Jun 12, 2025
Merged via the queue into main with commit 752cecc Jun 12, 2025
6 of 7 checks passed
@nablaone nablaone deleted the que-246-lack-of-schema-refresh-after-new-field-in-common-table branch June 12, 2025 14:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants