Conversation
410c7ff to
e497d0b
Compare
4e43530 to
f792683
Compare
3eb630d to
491ee41
Compare
cfe7f45 to
b56ae16
Compare
enjeck
left a comment
There was a problem hiding this comment.
if all comments are addressed, can be merged after conflict is fixed?
7009728 to
1c0ab5d
Compare
|
@enjeck I don't see any blockers. I did the rebase, fixed all conflicts, tested manually few CRUD operations and upgrade - everything works for me |
67990c6 to
35e05cd
Compare
|
@Koc loading views gives me a 500, likely related to them containing a meta column. |
| $cachedCells[$cell['columnId']] = $this->insertOrUpdateCell($sleeve->getId(), $cell['columnId'], $cell['value']); | ||
| } | ||
| $sleeve->setCachedCellsArray($cachedCells); | ||
| $this->rowSleeveMapper->update($sleeve); |
There was a problem hiding this comment.
since we have two updates that are related, they should be bundled in a transaction, as you pointed out. OCP\AppFramework\Db\TTransactional->atomic() can be used for convenience.
Also valid for insert logic, not just update.
There was a problem hiding this comment.
added atomic() + SELECT FOR UPDATE for databases that support it
Other yet unverified findings; unfold to read.Potentially BlockingB1 — Lost update on concurrent edits
Nextcloud pins the primary connection to READ COMMITTED Final cache Fix: re-read the sleeve with Collaborative editing is the point of this app, so this is reachable in normal use. B2 — No reconciliation pathOnce the cache diverges there is no way back. Architecture — worth settling before mergingThe join in the old query is dead weight, and removing it may be most of the win. Dropping the join — or going further and issuing five plain indexed If the cache is kept: it roughly doubles row-data storage, and MediumM1 — Fresh installs stay on the slow path until the next app update
A fresh install therefore never flips Fix: also list the step under Separately, confirm which server version introduced M2 — The backfill is an N+1 in a loop (AGENTS.md forbids this)Three call sites, all through
Fix for all three: one query per cell table over a batch of row IDs ( M3 — The rebuild also fires on ordinary empty rows
M4 — Rows the backfill cannot reach become silently empty
Fix: M5 —
|
35e05cd to
d2233db
Compare
|
@blizzz views loading works fine for me for both cached/non-cached scenarios. Can you provide more details (error/stacktrace) or just push fix?
Also I've fixed extra code review comments except B2, M2, M6, M7 and some minior |
|
Looking more closely, the stack trace is strange. No such issues on main though. Would not rule out that there could be an artifiact on my dev setup. Stacktrace
{
"reqId": "BHMc5EZhqoX5MrtyYIpW",
"level": 3,
"time": "2026-09-16T21:08:39+00:00",
"remoteAddr": "127.0.0.1",
"user": "master",
"app": "tables",
"method": "GET",
"url": "/index.php/apps/tables/row/view/872",
"scriptName": "/index.php",
"message": "An internal error or exception occurred: OCA\\Tables\\Db\\Row2Mapper - findAll: Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*tables_columns` WHERE `id` = :dcValue1\"; ",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:155.0) Gecko/20100101 Firefox/155.0",
"version": "36.0.0.0",
"exception": {
"Exception": "OCA\\Tables\\Errors\\InternalError",
"Message": "OCA\\Tables\\Db\\Row2Mapper - findAll: Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*tables_columns` WHERE `id` = :dcValue1\"; ",
"Code": 0,
"Trace": [
{
"file": "/srv/http/nextcloud/apps-repos/tables/lib/Service/RowService.php",
"line": 134,
"function": "findAll",
"class": "OCA\\Tables\\Db\\Row2Mapper",
"type": "->",
"args": [
[
-1,
-5,
5356,
5360
],
1465,
null,
null,
[],
[
{
"columnId": -5,
"mode": "DESC"
}
],
"master"
]
},
{
"file": "/srv/http/nextcloud/apps-repos/tables/lib/Controller/RowController.php",
"line": 57,
"function": "findAllByView",
"class": "OCA\\Tables\\Service\\RowService",
"type": "->",
"args": [
872,
"master"
]
},
{
"file": "/srv/http/nextcloud/apps-repos/tables/lib/Controller/Errors.php",
"line": 23,
"function": "{closure:OCA\\Tables\\Controller\\RowController::indexView():52}",
"class": "OCA\\Tables\\Controller\\RowController",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/srv/http/nextcloud/apps-repos/tables/lib/Controller/RowController.php",
"line": 52,
"function": "handleError",
"class": "OCA\\Tables\\Controller\\RowController",
"type": "->",
"args": [
{
"__class__": "Closure"
}
]
},
{
"file": "/srv/http/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 198,
"function": "indexView",
"class": "OCA\\Tables\\Controller\\RowController",
"type": "->",
"args": [
872
]
},
{
"file": "/srv/http/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 86,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Tables\\Controller\\RowController"
},
"indexView"
]
},
{
"file": "/srv/http/nextcloud/lib/private/AppFramework/App.php",
"line": 138,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Tables\\Controller\\RowController"
},
"indexView"
]
},
{
"file": "/srv/http/nextcloud/lib/private/Route/Router.php",
"line": 324,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Tables\\Controller\\RowController",
"indexView",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "tables.row.indexview",
"viewId": "872"
}
]
},
{
"file": "/srv/http/nextcloud/lib/OC.php",
"line": 1232,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/apps/tables/row/view/872"
]
},
{
"file": "/srv/http/nextcloud/index.php",
"line": 28,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
},
{
"file": "/srv/http/nextcloud/lib/OC.php",
"line": 1397,
"function": "{closure:/srv/http/nextcloud/index.php:25}",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/srv/http/nextcloud/index.php",
"line": 25,
"function": "handleRequests",
"class": "OC",
"type": "::",
"args": [
{
"__class__": "Closure"
}
]
}
],
"File": "/srv/http/nextcloud/apps-repos/tables/lib/Db/Row2Mapper.php",
"Line": 195,
"message": "An internal error or exception occurred: OCA\\Tables\\Db\\Row2Mapper - findAll: Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*tables_columns` WHERE `id` = :dcValue1\"; ",
"exception": "{\"class\":\"OCA\\Tables\\Errors\\InternalError\",\"message\":\"OCA\\Tables\\Db\\Row2Mapper - findAll: Did expect one result but found none when executing: query \\\"SELECT * FROM `*PREFIX*tables_columns` WHERE `id` = :dcValue1\\\"; \",\"code\":0,\"file\":\"/srv/http/nextcloud/apps-repos/tables/lib/Db/Row2Mapper.php:195\",\"trace\":\"#0 /srv/http/nextcloud/apps-repos/tables/lib/Service/RowService.php(134): OCA\\Tables\\Db\\Row2Mapper->findAll(Array, 1465, NULL, NULL, Array, Array, '...')\\n#1 /srv/http/nextcloud/apps-repos/tables/lib/Controller/RowController.php(57): OCA\\Tables\\Service\\RowService->findAllByView(872, '...')\\n#2 /srv/http/nextcloud/apps-repos/tables/lib/Controller/Errors.php(23): OCA\\Tables\\Controller\\RowController->{closure:OCA\\Tables\\Controller\\RowController::indexView():52}()\\n#3 /srv/http/nextcloud/apps-repos/tables/lib/Controller/RowController.php(52): OCA\\Tables\\Controller\\RowController->handleError(Object(Closure))\\n#4 /srv/http/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(198): OCA\\Tables\\Controller\\RowController->indexView(872)\\n#5 /srv/http/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(86): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Tables\\Controller\\RowController), '...')\\n#6 /srv/http/nextcloud/lib/private/AppFramework/App.php(138): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Tables\\Controller\\RowController), '...')\\n#7 /srv/http/nextcloud/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main('...', '...', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#8 /srv/http/nextcloud/lib/OC.php(1232): OC\\Route\\Router->match('...')\\n#9 /srv/http/nextcloud/index.php(28): OC::handleRequest()\\n#10 /srv/http/nextcloud/lib/OC.php(1397): {closure:/srv/http/nextcloud/index.php:25}()\\n#11 /srv/http/nextcloud/index.php(25): OC::handleRequests(Object(Closure))\\n#12 {main}\"}",
"CustomMessage": "An internal error or exception occurred: OCA\\Tables\\Db\\Row2Mapper - findAll: Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*tables_columns` WHERE `id` = :dcValue1\"; "
}
} |
This comment was marked as low quality.
This comment was marked as low quality.
|
PPS.:
results in the column data, but
results in zero results, hence the error. |
|
@blizzz reproduced and fixed 🎉
|
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
…s + locks) Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
…ary join) Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
…eta columns) Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>


This PR built on top of #2238.
Closes #1490.
It fixes loading of the large tables. Right now it is not possible to load a table with 30k rows and 8 columns due to an error:
PR contains 2 commits: fix itself and performance improvement.
I've measured latency for a various scenarios for
/row/table/{tableId}endpoint:📹 Video for performance comparison
Next step: move filtering/sorting/pagination to BE side and speedup FE. But this is completely separate topic which will be implemented in upcoming PRs.