pepdwill Honored Contributor.
Honored Contributor.
133 views

Document Version Incorrect

Seeing a strange issue with document versioning that I can't explain.

 

There is a document that has 3 versions.  The References tab (it was attached to a project via references) says that the current version is version 2.  However, clicking on the version history of the document shows that version 3 was checked in about 2 weeks ago, and there are no issues downloading this version.

 

Any ideas what may have caused this or how to fix?

 

For reference, I've attached screenshots of each of the KNTA_DOCUMENTS table, queried on this specific document.

 

KNTA_DOCUMENTS says version 2.  

KNTA_DOCUMENT_HISTORY_CONTENTS shows only 2 versions.

KNTA_DOCUMENT_VERSIONS shows 3 versions.

KNTA_DOCUMENT_TIP_CONTENTS says version 3.

 

 

Thanks-

Danny

 

0 Likes
5 Replies
mike_se Contributor.
Contributor.

Re: Document Version Incorrect

Hi Danny,

 

I cannot find the same behavior described in the Support Database.

 

Try creating a new Request, attach a Document, do the same steps where adding 2 more versions, and then compare the same query results.

 

If that test works as expected, was the Document in question part of a migration to DMS from either Documentum or regular PPM File System attachments?

 

-Mike

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Document Version Incorrect

Hi Danny,

 

KNTA_DOCUMENTS information is obviously out-of-sync (I don't know why), so you can fix the problem by updating its content (set VERSION_NUMBER to 3), and flush the documents cache.

 

It's expected that KNTA_DOCUMENT_HISTORY_CONTENTS table contains N-1 versions, since the latest version is always stored in KNTA_DOCUMENT_TIP_CONTENTS. 

 

I have no idea how this out-of-sync happened, but please let us know if you have many documents like that in your DB. You can easily come up with a SQL query that will list all the documents where version number is different in KNTA_DOCUMENT_TIP_CONTENTS and KNTA_DOCUMENTS (hint: DOCUMENT_ID is the shared key).

The best thing would obviously be to come up with steps to reproduce if possible.

 

As to explain why there's a discrepency on the UI, all the information displayed at first when watching a request attachments field comes from KNTA_DOCUMENTS table and is cached in the DOCUMENTS cache. However, from the moment you click to check a document details, a call to the DMS tables is done to retrieve the detailed information from the KNTA_DOCUMENT_* tables.

 

Thanks,

Etienne.

0 Likes
pepdwill Honored Contributor.
Honored Contributor.

Re: Document Version Incorrect

Thanks Etienne,

 

Some new and additional information.

 

This morning I tested to see if the issue would resolve itself, if I checked out the document and checked in a new version. 

 

I was greeted the following GUID error:

 

An unknown error has occurred. For more information, please contact your PPM administrator and provide the following GUID number:  GUID=2107AE0E-B2CD-E896-80BD-434B5093E7D5     
Generated Time=2014/02/27-09:39:52.115 CST

 

I will see about incrementing the version number like you said to see if that resolves this error, and will also run a query to see if there are many other documents in the system with this same issue.

 

The only other thing I can think to mention... we logged an issue last week related to the DMS.   Our system appears to be choking on large document upload (>15 megs).  We had our DBA monitor while upload a large document, and what he saw was surprising.

 

Essentially, it took 10 minutes for PPM to process a 20 meg document.  When I say "process", I mean it took 10 minutes for the document to show up in all of the KNTA_DOCUMENT.* tables (though the browser window timed out).   For the first 9 minutes, it appeared as if PPM was stuck in a loop, running the SQL below repeatedly.

 

SELECT t.doc_content AS content, t.version_number AS versionNumber
  FROM KNTA_DOCUMENT_TIP_CONTENTS t
 WHERE t.DOCUMENT_ID = :1
FOR UPDATE

 

So maybe these issues are somehow related.  I can give you the ticket # for this, if you'd like.

 

 

Thanks-

Danny

 

 

 

 

 

 

0 Likes
pepdwill Honored Contributor.
Honored Contributor.

Re: Document Version Incorrect

Adding to last comment... the description with the GUID error is as expected...

 

"sql error while save document version."

 

 

Also, I just ran a query to see if other documents have the problem, and fortunately only this one document has this versioning issue.

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Document Version Incorrect

Support ticket number would help, though I expect R&D will soon hear about that one through official support channel.

 

The current logic is that PPM will lock the KNTA_DOCUMENT_TIP_CONTENTS row with the given document ID before inserting the document binary contents. This should not happen until the document has been already fully uploaded to PPM (current behavior is to first upload the document to a temporary file, then stream the temporary file to the PPM BLOB column in KNTA_DOCUMENT_TIP_CONTENTS after locking the row with SELECT ... FOR UPDATE).

 

If the SELECT ... FOR UPDATE statement takes long to complete, it means the row is already locked by another transaction. You might want to focus your test scenarios on concurrently updating of a document by multiple users, as that's the only scenario that makes sense where a row would be already locked. The most likely root cause would be a deadlock, but without steps to reproduce we can't pinpoint what exactly is causing it.

 

Note that a 20 MB file shouldn't cause any specific issue to PPM Database DMS. We've routinely attached files larger than 1 GB during our tests procedures without any issue.

 

Thanks,

Etienne.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.