aboutsummaryrefslogtreecommitdiffstats
path: root/include/onedirsync.php
Commit message (Collapse)AuthorAgeFilesLines
* daemon conversion continued...redmatrix2016-05-191-82/+0
|
* cli utilities - argc and argv reversed. Not functionally incorrect since it ↵redmatrix2016-05-171-2/+2
| | | | was consistent but aesthetically incorrect.
* Merge branch 'master' into tres and add some work on the item_deleted flag ↵friendica2015-01-261-6/+6
|\ | | | | | | | | | | | | | | | | | | refactor Conflicts: include/attach.php include/onedirsync.php include/zot.php mod/locs.php
| * onedirsync issue reported by habeas codicefriendica2015-01-231-3/+2
| |
* | onedirsync mergefriendica2015-01-261-3/+2
| |
* | that should take care of the bitfields in hublocfriendica2015-01-201-1/+1
| |
* | first cut at unpacking bitfields in hubloc, fixed hubloc_error and ↵friendica2015-01-201-1/+1
|/ | | | hubloc_deleted
* more directory tuning to ignore things we already know we can't possibly updatefriendica2014-11-201-1/+6
|
* directory: don't try and sync a directory update that points to a hubloc we ↵friendica2014-11-201-1/+18
| | | | already know is dead and buried.
* PostgreSQL support initial commitHabeas Codice2014-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were 11 main types of changes: - UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just copied from Friendica. All of these instances, the LIMIT 1 was simply removed. - Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice to boot). Proper explicit boolean conversions were added. New queries should use proper conventions. - MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_ func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There were no true toggles (XOR). New queries should refrain from using XOR when not necessary. - There are several fields which the schema has marked as NOT NULL, but the inserts don't specify them. The reason this works is because mysql totally ignores the constraint and adds an empty text default automatically. Again, non-compliant, obviously. In these cases a default of empty text was added. - Several statements rely on a non-standard MySQL feature (http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run a zillion times faster, even on MySQL. - A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG, UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_ - INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes around the value -- assist functions added in the dba_ - NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are handled in Zot/item packets automagically by quoting all dates with dbescdate(). - char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype for all text fields in the postgres schema. varchar was used in a couple of places where it actually seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code actually validates data, new bugs might come out from under the rug. - postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted. bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function was added to handle this transparently. - postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax. Statements were updated to be standard. These changes require corresponding changes in the coding standards. Please review those before adding any code going forward. Still on my TODO list: - remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting - Rewrite search queries for better results (both MySQL and Postgres)
* directory sync optimisations to save redundant processingfriendica2013-10-151-0/+19
|
* why do these have invalid id's?friendica2013-10-141-1/+1
|
* extra loggingfriendica2013-10-141-1/+1
|
* don't update old entries with no addressfriendica2013-10-141-1/+1
|
* directory sync - this will either work, or it won't work, or it will ↵friendica2013-09-301-0/+42
possibly recurse and blow up the matrix. Hard to say. Do you feel lucky? Well do ya' ... punk? Rule #1 - don't mess with anything unless it's blowing up the matrix. If it doesn't blow up the matrix, but doesn't work, just let it go and let's figure out what it is doing and what it isn't doing. The flow is as follows: Once a day go out to all the directory servers besides yourself and grab a list of updates. This happens in the poller. If we've never seen them before add them to the updates table. The poller also looks to see if we're a directory server and have updates that haven't yet been processed. It calls onedirsync.php to process each one. If we contact the channel to update and don't find anything (we're just doing a basic zot_finger), set a ud_last timestamp. If this is set we will only try once a day for seven days. Then we stop trying to update. This will probably cause a spike the first time through because you haven't seen any updates before, but we spread out the load over your delivery interval.