-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fileid of oc_filecache in danger of hitting max value #26901
Comments
Uh oh... @butonic @DeepDiver1975 @PhilippSchaffrath |
It is even worse for us:
(and we split our users to different instances already) |
We usually don't change DB schemas in a minor version, but might need to do an exception here... @felixboehm @DeepDiver1975 @butonic I suggest to provide a PR for a quickfix that changes the column type to bigint (not sure about performance impact here during upgrade...) and address @butonic's other points separately. |
This one hadn't crossed my mind, but it's definitely a problem for us too.
It'll be a huge problem with our planned growth this year. |
Um ... this will require us to alter the sharing table and probably other tables that reference the fileid ... foreign keys anyone? |
Ref: foreign keys #13143 Indeed, not only the oc_filecache will be affected. Other tables that come to mind:
|
Need to also evaluate the impact of bigger values on the clients especially Javascript. |
Or use strings for ids: #22330. Not sure about the performance impact with indices though. |
just using bigint in dhe db is not enuogh. we neet to check if the code does cast to int, eg: https://github.com/owncloud/core/blob/master/lib/private/Files/Cache/Cache.php#L145 +1 for strings for ids and get this right. |
setting to triage, needs proper design + scheduling |
Uh oh... We need a fix ASAP:
|
Reproduction steps:
Expected: no limit
|
Apparently file/folder entries get created on-disk but not in DB. This means that after switching to bigint, will need to run |
@butonic I checked with a debugger, reading a bigint value from DB with PHP at the code in https://github.com/owncloud/core/blob/master/lib/private/Files/Cache/Cache.php#L140. The debugger shows that the fileid stayed the same for a value of |
@VicDeo how far are we from completion ? Have the backports to stable10 been done everywhere ? |
We still need to think of: Apparently some things already broke on 32-bit systems due to casting of the size column which was already a bigint a long time ago: #28275 |
Had a chat with @felixboehm and we'll only make sure that the bigint changes do not break OC completely on 32-bit systems for smaller values. However they will be no guarantee that values bigger than 32-bit are properly supported. So people with Rasperry Pis should still be able to use ownCloud fine assuming they don't scale to huge numbers. Raised QA ticket to retest 10.0.3 on 32-bit here owncloud/QA#476 |
@VicDeo are we done with phase 1? |
@PVince81 in general yes, but richdocuments and music should be ported to migrations for completion. |
moving to "planned" for second phase. |
@PVince81 What's the effect on the full id of this change? Currently 'getFileId()' in This works for the desktop client (takes all digits until first non-numeric character). |
@ckamm we should probably get rid of that weird compound id with padding and move to "oc:id" and have the instance id part exposed through the capabilities API ? (separate ticket) |
8 digits is only 99,999,999 = 100 million minus 1. 32 bit numbers anyway go to around 2,000,000,000 (signed) or 4,000,000,000 (unsigned) and thus would already be using 9 or 10 digits anyway (for installs with > 99,999,999 ids). So the 8-digit thing should be an existing "feature" regardless of 64-bit changes. |
@phil-davis Good point. @PVince81 Currently oc:id is the compound id and oc:fileid is the numeric one (opposite to the code in Node.php). We could start deprecating oc:id, the cost would be significant migration work in the client. I agree about moving this discussion to a separate ticket. The bigint change looks good from the desktop client's point of view. |
Raised #29437 to follow up with phase 2 and other ids. All the main ids (fileids and activity table ids) have been adjusted already, closing. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Database
5 node galera cluster with mariadb.
maxscale with read/write splitter.
Expected behaviour
virtually unlimited lifetime of oc service
Actual behaviour
the primary key of the filecache table is in danger of overflowing.
At that point our oc instance will refuse any addition of new files.
Problem description
The primary key is a signed integer with max value of 2147483647.
We have 60 mio files and the fileid is currently at 250 mio.
4 months ago that counter was at 146 mio. During the last 4 months we had a 3 node galera cluster.
That means 100 Mio increase in 4 months; with our new 5 node cluster instead of a old 3 nodes cluster that would have been a: 100/3*5 = 170 mio increase. Therefore we'll hit the 2147483647 boundary in about 3.5 years with the current user base and setup. However, given the growth rate of our service, I'd estimate that to be more something like 2 years at best.
Considering, that enterprise customers (at least those I know of) usually are one year behind the current release, I think it is about time to fix this in the db.
Please consider changing the fileid to BIGINT. Or at the very least make it unsigned.
More of a hack than a workaround would be to change the auto_increment settings.
But of course, that would give me tons of other head aches.
The text was updated successfully, but these errors were encountered: