[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-1682) duplicate key value violates unique constraint "jbm_msg_pkey" exceptions in a clustered
Howard Gao (JIRA)
jira-events at lists.jboss.org
Fri Jul 10 04:26:29 EDT 2009
[ https://jira.jboss.org/jira/browse/JBMESSAGING-1682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12475703#action_12475703 ]
Howard Gao commented on JBMESSAGING-1682:
-----------------------------------------
To keep the time longer, the node id has to shrink to give up more bits to time. Also we need to increase the granularity of the time bits. So I suggest the ID structure:
1) 10 bits node id (that allow node id to range from 0 to 1023).
2) 39 bits time from System.currentTimeMillis().
To make the time of repetition longer than 100 years using only 39 bits, we need to extract it from 4th bit to 42nd bit of the system time. So the time of repetition can be calculated as such
(2^39 - 1)/125/60/60/24/365.25 ====> about 139.36 years.
3) 15 bits counter. (range from 0 to 32767)
So the overall structure of a 64-bit ID is:
[10-bit node id][39-bit time][15-bit counter]
> duplicate key value violates unique constraint "jbm_msg_pkey" exceptions in a clustered
> ---------------------------------------------------------------------------------------
>
> Key: JBMESSAGING-1682
> URL: https://jira.jboss.org/jira/browse/JBMESSAGING-1682
> Project: JBoss Messaging
> Issue Type: Bug
> Components: JMS Clustering
> Affects Versions: 1.4.0.SP3.CP07, 1.4.0.SP3.CP08, 1.4.4.GA
> Reporter: Masao Kato
> Assignee: Howard Gao
> Priority: Blocker
> Fix For: 1.4.0.SP3.CP09, 1.4.5.GA
>
>
> NodeID(server peer id) of the cluster : in the adjoined identification number such as 0 and 1, 2 and 3.
> When message ID is generated at the same time, the exception might be generated by the duplicate of ID.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list