Orphaned data in table AccessMap

smilem

Joined: 2009-02-25
Posts: 110
Posted: Mon, 2009-10-26 23:34

Hi i have these Integrity Check errors in my G2.3

I delete all users and images. Still I get:

Check data integrity and report any inconsistencies.

Last Run Details:

Checked 124 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392

How do I fix this and prevent in the future?

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Tue, 2009-10-27 00:43

I doubt that 5 orphaned rows in a table will do any harm.

 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Tue, 2009-10-27 01:25
alecmyers wrote:
I doubt that 5 orphaned rows in a table will do any harm.

5 rows because I had 5 test users on my database usernames were

user1
user2
user3
user3
user4
user5

Ia have installed the Integrity Check module to check for problems and when I so DB errors I deleted them thinking the database problem will fix itself, but as you can see if I have live site with hundreds users than that will make hundreds of orphan records?

How can I delete those records? What table to edit and what to delete?
How can I prevent this from happening in the first place?

Thanks

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Tue, 2009-10-27 02:01

Well, on a whim, I decided to run an integrity check on my G2 installation that's been running well, for the last 12 months, with 204,000 items in the entity table. And there are a few orphaned entries in the AccessMap table. What do I intend to do about it? Nothing. It ain't bust, so no point trying to fix it.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-10-27 02:34

I too have a few orphaned items. No where near as many items in my Gallery but it's been running fine for 4-5 years like this....
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Tue, 2009-10-27 12:57

I created another test user and uploaded 4 photos.

Now I see:

Last Run Details:

Checked 66 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734

I deleted the user and got:

Last Run Details:

Checked 44 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734, 735

This isn't normal is it? Or the integrity module is absolete and outputs nonsense?

The rows reported are in the DB I checked them using phpMyadmin.
But on fresh gallery2.3 install (no users etc.) I installed integrity module and got this:

Last Run Details:

Checked 8 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10

My fresh install tables look like this:

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-10-27 15:45

What we are saying is, if Gallery is working, don't worry about it.

There's quite possibly something in the code that needs to be cleaned up or wasn't updated when something else was changed. But unless it's a security issue or major bug, I doubt anything will be done about it for G2. All major development are being focused on G3 right now.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Tue, 2009-10-27 18:43
nivekiam wrote:
What we are saying is, if Gallery is working, don't worry about it.

There's quite possibly something in the code that needs to be cleaned up or wasn't updated when something else was changed. But unless it's a security issue or major bug, I doubt anything will be done about it for G2. All major development are being focused on G3 right now.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

Will Gallery3 still work with the

checkout modules (byemail, paypal, downlaod etc.)
Will there be module like useralbums perhaps with built-in hack that makes each user to see their own albums ?

I'm still testing G2, but if G3 will have all this than perhaps I have to wait for stable build?

I still think somebody should take a look at gallery2 code and fix it ASAP.
Just do a clean install and you will see the problem like have shown you here.

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Tue, 2009-10-27 18:46
Quote:
Will Gallery3 still work with the

checkout modules (byemail, paypal, downlaod etc.)

No

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-10-27 18:55

Gallery 3 won't work with any G2 themes or plugins.

They all need to be re-written from scratch to work with G3. G3, just like G2 after G1 is a completely rewrite. They are 3 completely separate products that all do about the same thing only different in each case.

Quote:
I still think somebody should take a look at gallery2 code and fix it ASAP.

ASAP? Not going to happen. It's been like this for at least a year in 2.3 and probably existed in 2.2 and possibly 2.1, maybe even back in 2.0 and is an artifact left over from Alpha and Beta code. We're talking about 6 years back now. It's fine. Ignore it.

NO development is being done on G2 and this isn't a bug IMO, it's just not clean. G2 is a huge beast and all focus is being given to G3 for future development. If this was a security issue or causing G2 to not work it would be fixed, but that's it.

It's no different than your pages or css not validating 100%. It works and works just fine. There are problems and flaws with your car and house, your body and everything else you use, but they work. :)

G3 is the future, but it's going to take a while to build up the functionality that G2 has. G3 is easier to code for and we've already seen a faster adoption of people contributing modules and themes to G3. We're not even out of Beta yet and we've had more contributions to G3 than we did for G2 for the first year or two after it's initial release. G3 is going to be way more popular than G2 ever was, but it will still take time for people to write and contribute to it.

Right now, if you're looking for this functionality, I'd stick with G2. We're still supporting it (for probably years as we have done with G1), just not developing it. I wouldn't be surprised to see everything you're looking for available for G3 in 6-12 months after it's initial release.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Tue, 2009-10-27 21:22

Well I found out that as you add files to gallery, the Orphaned data increase in 8 id's every time. Tried to add 30 files, and after I added them I got more Orphaned data.

As I understand the Integrity Check reports in increment of 5 (read it another thread), so there can be new id'd even if you add just 1 photo.

As you say gallery2 works but, I can't undersant why is this not serious problem, won't it slow down gallery2 if I add hudred photos I have at least 20-30 orphaned fields of data. If a user orders same 100 photos another 20-30 fields of data. That is about ~50 orphaned fields (half) of the number photos that were uploaded.

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Tue, 2009-10-27 21:37
Quote:
Well I found out that as you add files to gallery, the Orphaned data increase in 8 id's every time.

Hmmm... well I currently have 67,000 photos (down from a peak of 80,000 last week) and only 5 or so orphaned items reported.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-10-27 22:08

And I have 3 much smaller G2 installs:

Install #1
Last Run Details:
Failed to load entity ids: 81, 175
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 9900

Install #2
Last Run Details:
Checked 1758 entities
Unknown plugin: theme ajaxian
Orphaned data in table PluginParameterMap with no row in PluginMap table; ids: theme/siriux_ijonized

Install #3 (tiny install, but very close to a fresh install with no modifications)
Last Run Details:
Checked 162 entities

All 3 of these installs have seen lots of installing and uninstalling of plugins, themes, etc. Install #1 is about 4-5 years old with many upgrades over the years and 155 photos. Install #2 is about 2-1/2 years old and 616 photos. Install #3 is about 3 months old with about 57 photos.

So reading what Alec posted along with what you posted I can only guess something isn't right with your install or possibly DB.

What setting do you have set for storage type in config.php? mysqlt, mysqli?

Who is your host?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Tue, 2009-10-27 22:23

>So reading what Alec posted along with what you posted I can only guess something
>isn't right with your install or possibly DB.

I agree with you.

>What setting do you have set for storage type in config.php? mysqlt, mysqli?

$storeConfig['type'] = 'mysqli';

>Who is your host?

www.321.lt (shared hosting)

You can see their server config here:
http://srv2.321.lt/info.php

 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Wed, 2009-10-28 01:21

Some observations:

host 321.lt (same test install as above)

before delete uploaded files from album

Checked 277 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734, 735, 789, 790, 791, 792, 793, 794, 795, 796, 797, 850, 851, 852, 853, 854, 855, 856, 857, 858, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173

after delete

Checked 97 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734, 735, 789, 790, 791, 792, 793, 794, 795, 796, 797, 850, 851, 852, 853, 854, 855, 856, 857, 858, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173

upload 40 files

Checked 216 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734, 735, 789, 790, 791, 792, 793, 794, 795, 796, 797, 850, 851, 852, 853, 854, 855, 856, 857, 858, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173

order prints

Checked 296 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734, 735, 789, 790, 791, 792, 793, 794, 795, 796, 797, 850, 851, 852, 853, 854, 855, 856, 857, 858, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173

delete album then delete user

Checked 175 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 387, 388, 390, 391, 392, 727, 728, 729, 730, 731, 732, 733, 734, 735, 789, 790, 791, 792, 793, 794, 795, 796, 797, 850, 851, 852, 853, 854, 855, 856, 857, 858, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174

Another host test:

clean install

Checked 8 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10, 11

after I install "remote" "upload applet" "useralbums" "registration"

Checked 10 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10, 11, 20, 21, 22, 23

After I upload 20 files

Checked 52 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10, 11, 20, 21, 22, 23

After I upload another 20 files

Checked 52 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10, 11, 20, 21, 22, 23

After I delete uploaded fiels:

Last Run Details:

Checked 11 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10, 11, 20, 21, 22, 23, 109, 110

After I upload same 40 files again in 1 session:

Checked 130 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10, 11, 20, 21, 22, 23, 109, 110

I delete the files:

Checked 11 entities
Orphaned data in table AccessMap with no row in AccessSubscriberMap table; ids: 8, 9, 10, 11, 20, 21, 22, 23, 109, 110

So I don not know what to think.... the problem is in the core module

 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Wed, 2009-10-28 17:07

I think, perhaps I could use SQL script to delete the orphan data in database? Then gallery2 would not get slower and slower. Anyone knows how to make it?

I could attach my AccessMap, AccessSubscriberMap SQL tables here.
I read this guide http://209.85.135.132/search?q=cache:EBrkmFhdyT0J:www.wellho.net/solutions/mysql-mysql-joins-using-left-join-and-right-join-to-find-orphan-rows.html+select+orphan+records+mysql&cd=1&hl=lt&ct=clnk&gl=lt

But did not fully understand how to make it.
I deleted the orphans by hand and here is my sql for it

AttachmentSize
orphans_removed_g2.sql_.txt1.71 KB
gallery2_g2.sql_.txt12.23 KB
 
smilem

Joined: 2009-02-25
Posts: 110
Posted: Thu, 2009-10-29 06:28

I found out that to view and delete orphan data.

The code deletes 200 rows from database, so imagine instead of 2mb db you would have to deal with 20mb db. This looks like a serious flaw to me., unless your host gives you unlimited mysql transactions (none of the shared hosting do)

You can use this in your phpmyadmin:

SELECT * FROM `g2_AccessMap`
WHERE `g_accessListId` NOT IN(
SELECT DISTINCT `g_accessListId` FROM `g2_AccessSubscriberMap`
);

and to delete the data just replace select with delete.

Who should I contact that this code would be included in integrity check module for g2.3? It should not be hard to do this.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22890
Posted: Thu, 2009-10-29 13:55

Development on G2 and the 3rd party module integrity check has stopped. If you care to continue development with either. Please join the development mailing list and we can show you want needs to be done in creating a fork of G2.3 in SVN and/or the -contrib branch.
Or you can develop the integrity check module and post the code here for others as well as update the codex page for the module.

All the devs are heads down on working on getting G3 working and there is no resources to work on G2.3 but if you care to contribute we are not holing you back.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team