Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. When your customer plans on opening a branch on the moon...

When your customer plans on opening a branch on the moon...

Scheduled Pinned Locked Moved The Lounge
javascriptcloudcsharplinqcom
23 Posts 13 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sander RosselS Sander Rossel

    I wonder how a construction mishap could end up with you working at Microsoft ;p I actually had an issue like that once. A service I wrote used an incremental int as ID. It probably generated a couple of 100 records a day, so an int would be large enough for the coming 14000 years at least. So the service worked well for a couple of months and then it started stuttering... Lots of calls would fail, but then a few would succeed and then it went well for a couple of days and then a batch of 100 failed again... It drove me mad, couldn't reproduce it in development, the failed messages were nothing out of the ordinary, a failed message could succeed a second time... And after weeks, maybe months, of searching, I finally found it! I don't remember why, but the auto-increment ID field rolled over to 1! It either used up all of its IDs due to a bug, or someone manually entered a really high ID and the auto-increment took it from there... The reason it sometimes worked is because a lot of IDs were missing, probably because I had to test a lot on production and I deleted those records. I'm pretty sure I was to blame, but I'd never thought about looking at a problem I did not expect to happen for the coming 14000 years. Found it on accident, but was able to fix it soon after that :laugh:

    Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

    D Offline
    D Offline
    davecasdf
    wrote on last edited by
    #21

    Powered up control panel, powered up - one at a time tool controllers and set IP addresses ( they come set to 192.168.0.4 ) powered up 4 at once. NO communication. Spent hours - bad switch? funky cables? ??? finally found 4 or 5 of them still had the chip default MAC address. Wanna know how to really confuse a switch? Had to go buy a null modem cable to program the right MACs. Globally unique id fail.

    1 Reply Last reply
    0
    • M Marc Clifton

      Just use a sequential ID and convert it into a GUID with an 8 character hex representation of the ID and the rest random stuff. Or:

      Quote:

      There a 5 versions of GUIDs defined in RFC 4122, each with different properties.

      Ask them to pick a version and take a vacation for a week while they argue it out. :laugh:

      Latest Articles:
      ASP.NET Core Web API: Plugin Controllers and Services

      M Offline
      M Offline
      Memtha
      wrote on last edited by
      #22

      I have to maintain a dedicated microservice that just makes guids. What type? Oh "the most random type!" ``` string s4() { return random.Int.ToString(16)[0]; } string newGuid() { return s4() + s4() + s4() + s4() + s4() + s4() + s4() + "-" + s4() + s4() + s4() + s4() + "-" + s4() + s4() + s4() + s4() + "-" + s4() + s4() + s4() + s4() + s4() + s4() + s4(); } ``` Why? Because "this is the only method our security scanner accepts so it must be the best"

      1 Reply Last reply
      0
      • O obermd

        The problem with GUID is "global" is limited to the machine that created the ID. This is in the definition details for GUIDs.

        M Offline
        M Offline
        Memtha
        wrote on last edited by
        #23

        That depends on the type. In theory, one of the types (I forget which) includes the computer's mac address (of the primary interface) so some ms docs come with the caviot like > Each GUID generated by using NEWSEQUENTIALID is unique on that computer. GUIDs generated by using NEWSEQUENTIALID are unique across multiple computers only if the source computer has a network card." [sql server NEWSEQUENTIALID docs](https://docs.microsoft.com/en-us/sql/t-sql/functions/newsequentialid-transact-sql?view=sql-server-ver15)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups